Search in sources :

Example 1 with CustomerHistoricalDataUpdateRequest

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);
}
Also used : CustomerHistoricalDataUpdateRequest(org.mifos.dto.domain.CustomerHistoricalDataUpdateRequest) Date(java.util.Date)

Example 2 with CustomerHistoricalDataUpdateRequest

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());
}
Also used : CustomerHistoricalDataUpdateRequest(org.mifos.dto.domain.CustomerHistoricalDataUpdateRequest) CustHistoricalDataActionForm(org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm) CustomerBO(org.mifos.customers.business.CustomerBO) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

CustomerHistoricalDataUpdateRequest (org.mifos.dto.domain.CustomerHistoricalDataUpdateRequest)2 Date (java.util.Date)1 CustomerBO (org.mifos.customers.business.CustomerBO)1 CustHistoricalDataActionForm (org.mifos.customers.struts.actionforms.CustHistoricalDataActionForm)1 CloseSession (org.mifos.framework.util.helpers.CloseSession)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1