Search in sources :

Example 1 with ActionTakenValue

use of org.kuali.rice.kew.actiontaken.ActionTakenValue in project cu-kfs by CU-CommunityApps.

the class CuDisbursementVoucherDocument method isCampusReviewRequired.

protected boolean isCampusReviewRequired() {
    List<ActionTakenValue> actions = RouteContext.getCurrentRouteContext().getDocument().getActionsTaken();
    List<String> people = new ArrayList<String>();
    for (ActionTakenValue atv : actions) {
        if (!people.contains(atv.getPrincipalId())) {
            people.add(atv.getPrincipalId());
        }
    }
    if (people.size() < 2) {
        return true;
    }
    List<AccountingLine> theList = (List<AccountingLine>) this.sourceAccountingLines;
    for (AccountingLine alb : theList) {
        ParameterEvaluator objectCodes = SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator("KFS-FP", "DisbursementVoucher", OBJECT_CODES_REQUIRING_CAMPUS_REVIEW, alb.getFinancialObjectCode());
        if (objectCodes.evaluationSucceeds()) {
            LOG.info("Object Code " + alb.getFinancialObjectCode() + " requires this document to undergo Campus review.");
            return true;
        }
    }
    ParameterEvaluator paymentReasons = SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator("KFS-FP", "DisbursementVoucher", PAYMENT_REASONS_REQUIRING_CAMPUS_REVIEW, this.dvPayeeDetail.getDisbVchrPaymentReasonCode());
    if (paymentReasons.evaluationSucceeds()) {
        return true;
    }
    String dollarThreshold = getParameterService().getParameterValueAsString("KFS-FP", "DisbursementVoucher", DOLLAR_THRESHOLD_REQUIRING_CAMPUS_REVIEW);
    KualiDecimal dollarThresholdDecimal = new KualiDecimal(dollarThreshold);
    if (this.disbVchrCheckTotalAmount.isGreaterEqual(dollarThresholdDecimal)) {
        return true;
    }
    return false;
}
Also used : AccountingLine(org.kuali.kfs.sys.businessobject.AccountingLine) ActionTakenValue(org.kuali.rice.kew.actiontaken.ActionTakenValue) ArrayList(java.util.ArrayList) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) List(java.util.List) ArrayList(java.util.ArrayList) ParameterEvaluator(org.kuali.rice.core.api.parameter.ParameterEvaluator) ParameterEvaluatorService(org.kuali.rice.core.api.parameter.ParameterEvaluatorService)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 AccountingLine (org.kuali.kfs.sys.businessobject.AccountingLine)1 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)1 ParameterEvaluatorService (org.kuali.rice.core.api.parameter.ParameterEvaluatorService)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1 ActionTakenValue (org.kuali.rice.kew.actiontaken.ActionTakenValue)1