Search in sources :

Example 1 with ACHBank

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;
}
Also used : IntegerFormatter(org.kuali.rice.core.web.format.IntegerFormatter) DateFormatter(org.kuali.rice.core.web.format.DateFormatter) Formatter(org.kuali.rice.core.web.format.Formatter) CurrencyFormatter(org.kuali.rice.core.web.format.CurrencyFormatter) CurrencyFormatter(org.kuali.rice.core.web.format.CurrencyFormatter) IntegerFormatter(org.kuali.rice.core.web.format.IntegerFormatter) ACHBank(org.kuali.kfs.pdp.businessobject.ACHBank)

Example 2 with ACHBank

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;
}
Also used : ACHBank(org.kuali.kfs.pdp.businessobject.ACHBank)

Aggregations

ACHBank (org.kuali.kfs.pdp.businessobject.ACHBank)2 CurrencyFormatter (org.kuali.rice.core.web.format.CurrencyFormatter)1 DateFormatter (org.kuali.rice.core.web.format.DateFormatter)1 Formatter (org.kuali.rice.core.web.format.Formatter)1 IntegerFormatter (org.kuali.rice.core.web.format.IntegerFormatter)1