Search in sources :

Example 1 with DisbursementType

use of org.kuali.kfs.pdp.businessobject.DisbursementType in project cu-kfs by CU-CommunityApps.

the class CuFormatServiceImpl method populateDisbursementType.

/**
 * This method sets the appropriate disbursement type on the Payment Group to either ACH or CHCK.
 *
 * @param paymentGroup
 */
protected void populateDisbursementType(PaymentGroup paymentGroup) {
    DisbursementType disbursementType = null;
    if (paymentGroup.isPayableByCheck()) {
        disbursementType = (DisbursementType) businessObjectService.findBySinglePrimaryKey(DisbursementType.class, PdpConstants.DisbursementTypeCodes.CHECK);
        paymentGroup.setDisbursementType(disbursementType);
        paymentGroup.setDisbursementTypeCode(PdpConstants.DisbursementTypeCodes.CHECK);
    } else {
        disbursementType = (DisbursementType) businessObjectService.findBySinglePrimaryKey(DisbursementType.class, PdpConstants.DisbursementTypeCodes.ACH);
        paymentGroup.setDisbursementType(disbursementType);
        paymentGroup.setDisbursementTypeCode(PdpConstants.DisbursementTypeCodes.ACH);
        CustomerProfile customer = paymentGroup.getBatch().getCustomerProfile();
        PayeeACHAccount payeeAchAccount = SpringContext.getBean(AchService.class).getAchInformation(paymentGroup.getPayeeIdTypeCd(), paymentGroup.getPayeeId(), customer.getAchTransactionType());
        paymentGroup.setAchBankRoutingNbr(payeeAchAccount.getBankRoutingNumber());
        paymentGroup.setAdviceEmailAddress(payeeAchAccount.getPayeeEmailAddress());
        paymentGroup.setAchAccountType(payeeAchAccount.getBankAccountTypeCode());
        AchAccountNumber achAccountNumber = new AchAccountNumber();
        achAccountNumber.setAchBankAccountNbr(payeeAchAccount.getBankAccountNumber());
        achAccountNumber.setId(paymentGroup.getId());
        paymentGroup.setAchAccountNumber(achAccountNumber);
    }
}
Also used : AchAccountNumber(org.kuali.kfs.pdp.businessobject.AchAccountNumber) PayeeACHAccount(org.kuali.kfs.pdp.businessobject.PayeeACHAccount) DisbursementType(org.kuali.kfs.pdp.businessobject.DisbursementType) CustomerProfile(org.kuali.kfs.pdp.businessobject.CustomerProfile) AchService(org.kuali.kfs.pdp.service.AchService)

Aggregations

AchAccountNumber (org.kuali.kfs.pdp.businessobject.AchAccountNumber)1 CustomerProfile (org.kuali.kfs.pdp.businessobject.CustomerProfile)1 DisbursementType (org.kuali.kfs.pdp.businessobject.DisbursementType)1 PayeeACHAccount (org.kuali.kfs.pdp.businessobject.PayeeACHAccount)1 AchService (org.kuali.kfs.pdp.service.AchService)1