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());
}
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());
}
Aggregations