use of org.kuali.kfs.pdp.businessobject.CustomerProfile 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);
}
}
use of org.kuali.kfs.pdp.businessobject.CustomerProfile in project cu-kfs by CU-CommunityApps.
the class CuFormatAction method prepare.
@Override
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
CuFormatForm formatForm = (CuFormatForm) form;
DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
if (formatForm.getCampus() == null) {
return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
// Figure out which ones they have selected
List selectedCustomers = new ArrayList();
for (CustomerProfile customer : formatForm.getCustomers()) {
if (customer.isSelectedForFormat()) {
selectedCustomers.add(customer);
}
}
Date paymentDate = dateTimeService.convertToSqlDate(formatForm.getPaymentDate());
Person kualiUser = GlobalVariables.getUserSession().getPerson();
FormatProcessSummary formatProcessSummary = ((CuFormatService) formatService).startFormatProcess(kualiUser, formatForm.getCampus(), selectedCustomers, paymentDate, formatForm.getPaymentTypes(), formatForm.getPaymentDistribution());
if (formatProcessSummary.getProcessSummaryList().size() == 0) {
KNSGlobalVariables.getMessageList().add(PdpKeyConstants.Format.ERROR_PDP_NO_MATCHING_PAYMENT_FOR_FORMAT);
return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
formatForm.setFormatProcessSummary(formatProcessSummary);
return mapping.findForward(PdpConstants.MAPPING_CONTINUE);
}
use of org.kuali.kfs.pdp.businessobject.CustomerProfile in project cu-kfs by CU-CommunityApps.
the class FormatAction method prepare.
/**
* This method marks the payments for format
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
FormatForm formatForm = (FormatForm) form;
DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
if (formatForm.getCampus() == null) {
return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
// Figure out which ones they have selected
List selectedCustomers = new ArrayList();
for (CustomerProfile customer : formatForm.getCustomers()) {
if (customer.isSelectedForFormat()) {
selectedCustomers.add(customer);
}
}
Date paymentDate = dateTimeService.convertToSqlDate(formatForm.getPaymentDate());
Person kualiUser = GlobalVariables.getUserSession().getPerson();
FormatProcessSummary formatProcessSummary = formatService.startFormatProcess(kualiUser, formatForm.getCampus(), selectedCustomers, paymentDate, formatForm.getPaymentTypes());
if (formatProcessSummary.getProcessSummaryList().size() == 0) {
KNSGlobalVariables.getMessageList().add(PdpKeyConstants.Format.ERROR_PDP_NO_MATCHING_PAYMENT_FOR_FORMAT);
return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
formatForm.setFormatProcessSummary(formatProcessSummary);
return mapping.findForward(PdpConstants.MAPPING_CONTINUE);
}
use of org.kuali.kfs.pdp.businessobject.CustomerProfile in project cu-kfs by CU-CommunityApps.
the class FormatAction method clear.
/**
* This method clears all the customer checkboxes.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward clear(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
FormatForm formatForm = (FormatForm) form;
List<CustomerProfile> customers = formatForm.getCustomers();
for (CustomerProfile customerProfile : customers) {
customerProfile.setSelectedForFormat(false);
}
formatForm.setCustomers(customers);
return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
use of org.kuali.kfs.pdp.businessobject.CustomerProfile in project cu-kfs by CU-CommunityApps.
the class CuAchAdviceNotificationServiceImpl method sendAdviceNotifications.
/**
* Set to NonTransactional so the payment advice email sent date will be updated and saved after the email is sent
*
* @see org.kuali.kfs.pdp.batch.service.AchAdviceNotificationService#sendAdviceNotifications()
*/
@NonTransactional
public void sendAdviceNotifications() {
if (achBundlerHelperService.shouldBundleAchPayments()) {
// ACH payments were bundled so the corresponding advice email notifications should also be bundled
HashSet<Integer> disbNbrs = achBundlerAdviceDao.getDistinctDisbursementNumbersForAchPaymentsNeedingAdviceNotification();
for (Iterator<Integer> disbIter = disbNbrs.iterator(); disbIter.hasNext(); ) {
Integer disbursementNbr = disbIter.next();
// get all payment details to include in the advice based on disbursement number which is associated to a single vendor
List<PaymentDetail> paymentDetails = achBundlerAdviceDao.getAchPaymentDetailsNeedingAdviceNotificationByDisbursementNumber(disbursementNbr);
// get one payment detail record so that we can get the needed payment group record, since all payment details are for the same vendor, all payment group records should match
Iterator<PaymentDetail> paymentDetailsIter = paymentDetails.iterator();
PaymentDetail payDetail = paymentDetailsIter.next();
PaymentGroup payGroup = payDetail.getPaymentGroup();
CustomerProfile customer = payGroup.getBatch().getCustomerProfile();
// verify the customer profile is setup to create advices
if (customer.getAdviceCreate()) {
pdpEmailService.sendAchAdviceEmail(payGroup, paymentDetails, customer);
}
// update sent date on the payment, must loop through all payment details because payment groups could be unique.
for (Iterator<PaymentDetail> paymentDetailsIter2 = paymentDetails.iterator(); paymentDetailsIter2.hasNext(); ) {
PaymentDetail pd = paymentDetailsIter2.next();
PaymentGroup pg = pd.getPaymentGroup();
pg.setAdviceEmailSentDate(dateTimeService.getCurrentTimestamp());
businessObjectService.save(pg);
}
}
// for each disb number
} else {
// Execute the original KFS code to send unbundled ACH advice email notifications with a
// change to the looping on the payment detail records as noted below with notation KFSPTS-1460
// get list of payments to send notification for
List<PaymentGroup> paymentGroups = paymentGroupService.getAchPaymentsNeedingAdviceNotification();
for (PaymentGroup paymentGroup : paymentGroups) {
CustomerProfile customer = paymentGroup.getBatch().getCustomerProfile();
// verify the customer profile is setup to create advices
if (customer.getAdviceCreate()) {
// KFSPTS-1460 - for loop removed
// for (PaymentDetail paymentDetail : paymentGroup.getPaymentDetails()) {
// pdpEmailService.sendAchAdviceEmail(paymentGroup, paymentDetail, customer);
// }
List<PaymentDetail> paymentDetails = paymentGroup.getPaymentDetails();
pdpEmailService.sendAchAdviceEmail(paymentGroup, paymentDetails, customer);
}
// update advice sent date on payment
paymentGroup.setAdviceEmailSentDate(dateTimeService.getCurrentTimestamp());
businessObjectService.save(paymentGroup);
}
}
}
Aggregations