Search in sources :

Example 1 with PaymentMethod

use of edu.cornell.kfs.fp.businessobject.PaymentMethod in project cu-kfs by CU-CommunityApps.

the class PaymentMethodRule method processCustomRouteDocumentBusinessRules.

@Override
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
    boolean continueRouting = super.processCustomRouteDocumentBusinessRules(document);
    PaymentMethod paymentMethod = (PaymentMethod) document.getNewMaintainableObject().getBusinessObject();
    // checks on the main record
    GlobalVariables.getMessageMap().clearErrorPath();
    GlobalVariables.getMessageMap().addToErrorPath("document.newMaintainableObject");
    // TODO : This is a hack now, foreign draft does not need this check
    if (!StringUtils.equals(PaymentMethod.PM_CODE_FOREIGN_DRAFT, paymentMethod.getPaymentMethodCode()) && !StringUtils.equals(PaymentMethod.PM_CODE_WIRE, paymentMethod.getPaymentMethodCode())) {
        continueRouting &= sanityCheckFlags(paymentMethod);
    }
    continueRouting &= checkNeedForBankCode(paymentMethod);
    // checks on the chart records
    for (int i = 0; i < paymentMethod.getPaymentMethodCharts().size(); i++) {
        GlobalVariables.getMessageMap().addToErrorPath("paymentMethodCharts[" + i + "]");
        PaymentMethodChart paymentMethodChart = paymentMethod.getPaymentMethodCharts().get(i);
        if (paymentMethodChart.isNewCollectionRecord()) {
            continueRouting &= isNewEffectiveDateInFuture(paymentMethod.getPaymentMethodCharts().get(i));
            continueRouting &= checkFeeInformation(paymentMethod, paymentMethod.getPaymentMethodCharts().get(i));
            continueRouting &= checkClearingAccountInformation(paymentMethod, paymentMethod.getPaymentMethodCharts().get(i));
        }
        GlobalVariables.getMessageMap().removeFromErrorPath("paymentMethodCharts[" + i + "]");
    }
    GlobalVariables.getMessageMap().removeFromErrorPath("document.newMaintainableObject");
    return continueRouting;
}
Also used : PaymentMethodChart(edu.cornell.kfs.fp.businessobject.PaymentMethodChart) PaymentMethod(edu.cornell.kfs.fp.businessobject.PaymentMethod)

Example 2 with PaymentMethod

use of edu.cornell.kfs.fp.businessobject.PaymentMethod in project cu-kfs by CU-CommunityApps.

the class PaymentMethodValuesFinder method getKeyValues.

/*
     * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
     */
public List<KeyValue> getKeyValues() {
    Collection<PaymentMethod> paymentMethods = getBusinessObjectService().findMatchingOrderBy(PaymentMethod.class, getFilterCriteria(), "paymentMethodName", true);
    List<KeyValue> labels = new ArrayList<KeyValue>(paymentMethods.size());
    for (PaymentMethod pm : paymentMethods) {
        labels.add(new ConcreteKeyValue(pm.getPaymentMethodCode(), pm.getPaymentMethodCode() + " - " + pm.getPaymentMethodName()));
    }
    return labels;
}
Also used : ConcreteKeyValue(org.kuali.rice.core.api.util.ConcreteKeyValue) KeyValue(org.kuali.rice.core.api.util.KeyValue) ConcreteKeyValue(org.kuali.rice.core.api.util.ConcreteKeyValue) ArrayList(java.util.ArrayList) PaymentMethod(edu.cornell.kfs.fp.businessobject.PaymentMethod)

Aggregations

PaymentMethod (edu.cornell.kfs.fp.businessobject.PaymentMethod)2 PaymentMethodChart (edu.cornell.kfs.fp.businessobject.PaymentMethodChart)1 ArrayList (java.util.ArrayList)1 ConcreteKeyValue (org.kuali.rice.core.api.util.ConcreteKeyValue)1 KeyValue (org.kuali.rice.core.api.util.KeyValue)1