use of org.kuali.kfs.pdp.businessobject.ACHBank in project cu-kfs by CU-CommunityApps.
the class CuPdpEmailServiceImpl method createAdviceMessageBody.
/**
* KFSPTS-1460: New method. Created from code in sendAchAdviceEmail and new code.
* All content in the body of the email message is created in this method regardless
* of the number of payment details for the payment group.
*/
private StringBuffer createAdviceMessageBody(PaymentGroup paymentGroup, CustomerProfile customer, KualiDecimal netPaymentAmount, Integer numPayments) {
LOG.debug("createAdviceMessageBody() starting");
// formatter for payment amounts
Formatter moneyFormatter = new CurrencyFormatter();
Formatter integerFormatter = new IntegerFormatter();
String payeeName = "";
if (paymentGroup.getPayeeName() != null) {
payeeName = paymentGroup.getPayeeName();
}
String paymentDescription = "";
if (customer.getAchPaymentDescription() != null) {
paymentDescription = customer.getAchPaymentDescription();
}
StringBuffer body = new StringBuffer();
body.append(getMessage(CUPdpKeyConstants.MESSAGE_PDP_ACH_ADVICE_EMAIL_BODY_PAYMENT_TO, payeeName));
body.append(getMessage(CUPdpKeyConstants.MESSAGE_PDP_ACH_ADVICE_EMAIL_BODY_PAYMENT_FROM, paymentDescription));
// get bank name to which the payment is being transferred
String bankName = "";
ACHBank achBank = achBankService.getByPrimaryId(paymentGroup.getAchBankRoutingNbr());
if (achBank == null) {
LOG.error("Bank cound not be found for routing number " + paymentGroup.getAchBankRoutingNbr());
} else {
bankName = achBank.getBankName();
}
String disbNbr = "";
if (paymentGroup.getDisbursementNbr() != null) {
disbNbr = (String) integerFormatter.formatForPresentation(paymentGroup.getDisbursementNbr());
}
// verbiage stating bank, net amount, and disb num that was sent
body.append(getMessage(CUPdpKeyConstants.MESSAGE_PDP_ACH_ADVICE_EMAIL_BODY_BANK_AMOUNT, bankName, moneyFormatter.formatForPresentation(netPaymentAmount), disbNbr));
// verbiage stating when the deposit should be expected
body.append(getMessage(CUPdpKeyConstants.MESSAGE_PDP_ACH_ADVICE_EMAIL_BODY_DEPOSIT_DAYS));
// verbiage stating the number of payments the net deposit was for
body.append(getMessage(CUPdpKeyConstants.MESSAGE_PDP_ACH_ADVICE_EMAIL_BODY_DEPOSIT_NUM_PAYMENTS, integerFormatter.formatForPresentation(numPayments.toString())));
return body;
}
use of org.kuali.kfs.pdp.businessobject.ACHBank in project cu-kfs by CU-CommunityApps.
the class PayeeACHAccountExtractServiceImplTest method createBank.
private ACHBank createBank(String bankRoutingNumber, String bankName) {
ACHBank bank = new ACHBank();
bank.setBankRoutingNumber(bankRoutingNumber);
bank.setBankName(bankName);
bank.setActive(true);
return bank;
}
Aggregations