use of org.mifos.accounts.loan.struts.actionforms.LoanAccountActionForm in project head by mifos.
the class LoanAccountAction method captureQuestionResponses.
@TransactionDemarcate(joinToken = true)
@Override
public ActionForward captureQuestionResponses(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
request.setAttribute(METHODCALLED, "captureQuestionResponses");
LoanAccountActionForm actionForm = (LoanAccountActionForm) form;
setPerspective(request, actionForm.getPerspective());
ActionErrors errors = createLoanQuestionnaire.validateResponses(request, actionForm);
if (errors != null && !errors.isEmpty()) {
addErrors(request, errors);
return mapping.findForward(ActionForwards.captureQuestionResponses.toString());
}
return createLoanQuestionnaire.rejoinFlow(mapping);
}
use of org.mifos.accounts.loan.struts.actionforms.LoanAccountActionForm in project head by mifos.
the class LoanAccountAction method getGroupLoanRepaymentSchedule.
@TransactionDemarcate(joinToken = true)
public ActionForward getGroupLoanRepaymentSchedule(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
LoanAccountActionForm loanAccountActionForm = (LoanAccountActionForm) form;
UserContext userContext = getUserContext(request);
Integer grouploanId = Integer.valueOf(request.getParameter(ACCOUNT_ID));
Locale locale = userContext.getPreferredLocale();
Date viewDate = loanAccountActionForm.getScheduleViewDateValue(locale);
LoanBO groupLoan = getLoan(grouploanId);
LoanAccountAction.setSessionAtributeForGLIM(request, groupLoan);
groupLoan.updateDetails(userContext);
Errors errors = loanBusinessService.computeExtraInterest(groupLoan, viewDate);
if (errors.hasErrors()) {
loanAccountActionForm.resetScheduleViewDate();
}
List<LoanBO> membersAccount = this.loanDao.findIndividualLoans(grouploanId);
List<Integer> membersAccountIds = getMembersAccountId(membersAccount);
OriginalScheduleInfoDto generatedSchedule = OriginalScheduleInfoHelper.sumRepaymentSchedule(getMembersSchedule(membersAccountIds));
SessionUtils.setAttribute(Constants.BUSINESS_KEY, groupLoan, request);
SessionUtils.setAttribute(Constants.VIEW_DATE, viewDate, request);
SessionUtils.setAttribute(Constants.ORIGINAL_SCHEDULE_AVAILABLE, generatedSchedule.hasOriginalInstallments(), request);
SessionUtils.setAttribute("isNewGropLoan", Boolean.TRUE, request);
String forward = errors.hasErrors() ? ActionForwards.getLoanRepaymentScheduleFailure.toString() : ActionForwards.getLoanRepaymentSchedule.toString();
addErrors(request, getActionErrors(errors));
return mapping.findForward(forward);
}
Aggregations