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;
}
Aggregations