use of org.mifos.dto.domain.CustomerHistoricalDataUpdateRequest in project head by mifos.
the class CustHistoricalDataAction method createHistoricalDataUpdateRequest.
private CustomerHistoricalDataUpdateRequest createHistoricalDataUpdateRequest(CustHistoricalDataActionForm historicalActionForm, UserContext userContext) throws InvalidDateException {
String interestPaid = historicalActionForm.getInterestPaid();
String loanAmount = historicalActionForm.getLoanAmount();
Integer loanCycleNumber = historicalActionForm.getLoanCycleNumberValue();
Integer missedPaymentsCount = historicalActionForm.getMissedPaymentsCountValue();
String notes = historicalActionForm.getCommentNotes();
String productName = historicalActionForm.getProductName();
String totalAmountPaid = historicalActionForm.getTotalAmountPaid();
Integer totalPaymentsCount = historicalActionForm.getTotalPaymentsCountValue();
Date mfiJoiningDate = getDateFromString(historicalActionForm.getMfiJoiningDate(), userContext.getPreferredLocale());
return new CustomerHistoricalDataUpdateRequest(mfiJoiningDate, interestPaid, loanAmount, loanCycleNumber, missedPaymentsCount, notes, productName, totalAmountPaid, totalPaymentsCount);
}
use of org.mifos.dto.domain.CustomerHistoricalDataUpdateRequest in project head by mifos.
the class CustHistoricalDataAction method updateHistoricalData.
@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward updateHistoricalData(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustomerBO customerBOInSession = (CustomerBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
CustomerBO customerBO = this.customerDao.findCustomerById(customerBOInSession.getCustomerId());
checkVersionMismatch(customerBOInSession.getVersionNo(), customerBO.getVersionNo());
customerBO.setUserContext(getUserContext(request));
CustHistoricalDataActionForm historicalActionForm = (CustHistoricalDataActionForm) form;
CustomerHistoricalDataUpdateRequest historicalData = createHistoricalDataUpdateRequest(historicalActionForm, getUserContext(request));
this.groupServiceFacade.updateCustomerHistoricalData(customerBO.getGlobalCustNum(), historicalData);
return mapping.findForward(ActionForwards.updateHistoricalData_success.toString());
}
Aggregations