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