Search in sources :

Example 1 with ReverseLoanDisbursalActionForm

use of org.mifos.accounts.loan.struts.actionforms.ReverseLoanDisbursalActionForm in project head by mifos.

the class ReverseLoanDisbursalAction method update.

@TransactionDemarcate(validateAndResetToken = true)
public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("Inside update method");
    ReverseLoanDisbursalActionForm actionForm = (ReverseLoanDisbursalActionForm) form;
    LoanBO loan = (LoanBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
    this.loanAccountServiceFacade.reverseLoanDisbursal(loan.getGlobalAccountNum(), actionForm.getNote());
    if (loan.isGroupLoanAccountParent()) {
        for (LoanBO member : loan.getMemberAccounts()) {
            this.loanAccountServiceFacade.reverseLoanDisbursal(member.getGlobalAccountNum(), actionForm.getNote());
        }
    }
    logger.debug("Outside update method");
    return mapping.findForward(ActionForwards.update_success.toString());
}
Also used : ReverseLoanDisbursalActionForm(org.mifos.accounts.loan.struts.actionforms.ReverseLoanDisbursalActionForm) LoanBO(org.mifos.accounts.loan.business.LoanBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with ReverseLoanDisbursalActionForm

use of org.mifos.accounts.loan.struts.actionforms.ReverseLoanDisbursalActionForm in project head by mifos.

the class ReverseLoanDisbursalAction method load.

@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("Inside load method");
    ReverseLoanDisbursalActionForm actionForm = (ReverseLoanDisbursalActionForm) form;
    String searchString = actionForm.getSearchString();
    String globalAccountNum = searchString;
    if (StringUtils.isNotEmpty(globalAccountNum)) {
        globalAccountNum = globalAccountNum.trim();
    }
    List<LoanActivityDto> payments = this.loanAccountServiceFacade.retrieveLoanPaymentsForReversal(globalAccountNum);
    LoanBO loan = this.loanDao.findByGlobalAccountNum(globalAccountNum);
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, loan, request);
    SessionUtils.setCollectionAttribute(LoanConstants.PAYMENTS_LIST, payments, request);
    SessionUtils.setAttribute(LoanConstants.PAYMENTS_SIZE, payments.size(), request);
    logger.debug("Outside load method");
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : ReverseLoanDisbursalActionForm(org.mifos.accounts.loan.struts.actionforms.ReverseLoanDisbursalActionForm) LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) LoanBO(org.mifos.accounts.loan.business.LoanBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

LoanBO (org.mifos.accounts.loan.business.LoanBO)2 ReverseLoanDisbursalActionForm (org.mifos.accounts.loan.struts.actionforms.ReverseLoanDisbursalActionForm)2 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)2 LoanActivityDto (org.mifos.dto.domain.LoanActivityDto)1