use of org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm in project head by mifos.
the class CustHistoricalDataAction method getDetailAccountPage.
private String getDetailAccountPage(ActionForm form) {
CustHistoricalDataActionForm actionForm = (CustHistoricalDataActionForm) form;
String type = actionForm.getType();
String forward = null;
if (type.equals("Group")) {
forward = ActionForwards.group_detail_page.toString();
} else if (type.equals("Client")) {
forward = ActionForwards.client_detail_page.toString();
}
return forward;
}
use of org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm in project head by mifos.
the class CustHistoricalDataAction method getHistoricalData.
@TransactionDemarcate(saveToken = true)
public ActionForward getHistoricalData(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustHistoricalDataActionForm actionForm = (CustHistoricalDataActionForm) form;
String globalCustNum = request.getParameter(CustomerConstants.GLOBAL_CUST_NUM);
CustomerHistoricalDataDto historicalData = this.groupServiceFacade.retrieveCustomerHistoricalData(globalCustNum);
CustomerBO customer = this.customerDao.findCustomerBySystemId(globalCustNum);
UserContext userContext = getUserContext(request);
customer.updateDetails(userContext);
if (historicalData.isClient()) {
actionForm.setType("Client");
} else if (historicalData.isGroup()) {
actionForm.setType("Group");
}
CustomerHistoricalDataEntity customerHistoricalDataEntity = customer.getHistoricalData();
if (customerHistoricalDataEntity == null) {
customerHistoricalDataEntity = new CustomerHistoricalDataEntity(customer);
}
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, customer, request);
SessionUtils.setAttribute(CustomerConstants.MFIJOININGDATE, historicalData.getMfiJoiningDate(), request);
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_HISTORICAL_DATA, customerHistoricalDataEntity, request);
return mapping.findForward(ActionForwards.getHistoricalData_success.toString());
}
use of org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm in project head by mifos.
the class CustHistoricalDataAction method loadHistoricalData.
@TransactionDemarcate(joinToken = true)
public ActionForward loadHistoricalData(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
CustHistoricalDataActionForm historicalActionForm = (CustHistoricalDataActionForm) form;
UserContext userContext = getUserContext(request);
CustomerHistoricalDataEntity customerHistoricalDataEntity = (CustomerHistoricalDataEntity) SessionUtils.getAttribute(CustomerConstants.CUSTOMER_HISTORICAL_DATA, request);
historicalActionForm.setInterestPaid(getStringValue(customerHistoricalDataEntity.getInterestPaid()));
historicalActionForm.setLoanAmount(getStringValue(customerHistoricalDataEntity.getLoanAmount()));
historicalActionForm.setLoanCycleNumber(getStringValue(customerHistoricalDataEntity.getLoanCycleNumber()));
historicalActionForm.setMissedPaymentsCount(getStringValue(customerHistoricalDataEntity.getMissedPaymentsCount()));
historicalActionForm.setCommentNotes(customerHistoricalDataEntity.getNotes());
historicalActionForm.setProductName(customerHistoricalDataEntity.getProductName());
historicalActionForm.setTotalAmountPaid(getStringValue(customerHistoricalDataEntity.getTotalAmountPaid()));
historicalActionForm.setTotalPaymentsCount(getStringValue(customerHistoricalDataEntity.getTotalPaymentsCount()));
String mfiJoiningDate = SessionUtils.getAttribute(CustomerConstants.MFIJOININGDATE, request).toString();
historicalActionForm.setMfiJoiningDate(DateUtils.getUserLocaleDate(userContext.getPreferredLocale(), mfiJoiningDate));
return mapping.findForward(ActionForwards.loadHistoricalData_success.toString());
}
use of org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm 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