use of org.mifos.dto.domain.LoanInstallmentDetailsDto in project head by mifos.
the class LoanAccountAction method getInstallmentDetails.
@TransactionDemarcate(joinToken = true)
public ActionForward getInstallmentDetails(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception {
Integer accountId = Integer.valueOf(request.getParameter(ACCOUNT_ID));
LoanInstallmentDetailsDto loanInstallmentDetailsDto = this.loanAccountServiceFacade.retrieveInstallmentDetails(accountId);
SessionUtils.setAttribute(VIEW_UPCOMING_INSTALLMENT_DETAILS, loanInstallmentDetailsDto.getUpcomingInstallmentDetails(), request);
SessionUtils.setAttribute(VIEW_OVERDUE_INSTALLMENT_DETAILS, loanInstallmentDetailsDto.getOverDueInstallmentDetails(), request);
SessionUtils.setAttribute(TOTAL_AMOUNT_OVERDUE, loanInstallmentDetailsDto.getTotalAmountDue(), request);
SessionUtils.setAttribute(NEXTMEETING_DATE, loanInstallmentDetailsDto.getNextMeetingDate(), request);
if (null == this.loanDao.findById(accountId).getParentAccount() && this.loanDao.findById(accountId).isGroupLoanAccount()) {
SessionUtils.setAttribute("isNewGlim", "isNewGlim", request);
}
return mapping.findForward(VIEWINSTALLMENTDETAILS_SUCCESS);
}
use of org.mifos.dto.domain.LoanInstallmentDetailsDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveInstallmentDetails.
@Override
public LoanInstallmentDetailsDto retrieveInstallmentDetails(Integer accountId) {
MifosUser mifosUser = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = new UserContextFactory().create(mifosUser);
LoanBO loanBO = this.loanDao.findById(accountId);
try {
personnelDao.checkAccessPermission(userContext, loanBO.getOfficeId(), loanBO.getCustomer().getLoanOfficerId());
} catch (AccountException e) {
throw new MifosRuntimeException(e.getMessage(), e);
}
InstallmentDetailsDto viewUpcomingInstallmentDetails;
InstallmentDetailsDto viewOverDueInstallmentDetails;
if (loanBO.isGroupLoanAccount() && null == loanBO.getParentAccount()) {
List<AccountActionDateEntity> memberDetailsOfNextInstallment = new ArrayList<AccountActionDateEntity>();
List<List<AccountActionDateEntity>> memberDetailsOfInstallmentsInArrears = new ArrayList<List<AccountActionDateEntity>>();
for (LoanBO member : loanBO.getMemberAccounts()) {
memberDetailsOfNextInstallment.add(member.getDetailsOfNextInstallment());
memberDetailsOfInstallmentsInArrears.add(member.getDetailsOfInstallmentsInArrears());
}
viewUpcomingInstallmentDetails = getUpcomingInstallmentDetailsForGroupLoan(memberDetailsOfNextInstallment, loanBO.getCurrency());
viewOverDueInstallmentDetails = getOverDueInstallmentDetailsForGroupLoan(memberDetailsOfInstallmentsInArrears, loanBO.getCurrency());
} else {
viewUpcomingInstallmentDetails = getUpcomingInstallmentDetails(loanBO.getDetailsOfNextInstallment(), loanBO.getCurrency());
viewOverDueInstallmentDetails = getOverDueInstallmentDetails(loanBO.getDetailsOfInstallmentsInArrears(), loanBO.getCurrency());
}
Money upcomingInstallmentSubTotal = new Money(loanBO.getCurrency(), viewUpcomingInstallmentDetails.getSubTotal());
Money overdueInstallmentSubTotal = new Money(loanBO.getCurrency(), viewOverDueInstallmentDetails.getSubTotal());
Money totalAmountDue = upcomingInstallmentSubTotal.add(overdueInstallmentSubTotal);
return new LoanInstallmentDetailsDto(viewUpcomingInstallmentDetails, viewOverDueInstallmentDetails, totalAmountDue.toString(), loanBO.getNextMeetingDate());
}
use of org.mifos.dto.domain.LoanInstallmentDetailsDto in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountNextInstallmentDetails.
@RequestMapping(value = "/viewLoanAccountNextInstallmentDetails", method = RequestMethod.GET)
public ModelAndView showLoanAccountNextInstallmentDetails(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountNextInstallmentDetails", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
LoanInstallmentDetailsDto loanInstallmentDetailsDto = this.loanAccountServiceFacade.retrieveInstallmentDetails(loanInformationDto.getAccountId());
modelAndView.addObject("loanInformationDto", loanInformationDto);
modelAndView.addObject("loanInstallmentDetailsDto", loanInstallmentDetailsDto);
this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
Aggregations