use of org.mifos.dto.domain.OriginalScheduleInfoDto in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountRepaymentSchedule.
@RequestMapping(value = "/viewLoanAccountRepaymentSchedule", method = RequestMethod.GET)
public ModelAndView showLoanAccountRepaymentSchedule(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountRepaymentSchedule", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
modelAndView.addObject("currentDate", new Date());
OriginalScheduleInfoDto originalScheduleInfoDto = loanAccountServiceFacade.retrieveOriginalLoanSchedule(globalAccountNum);
modelAndView.addObject("isOriginalScheduleAvailable", originalScheduleInfoDto.hasOriginalInstallments());
this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
use of org.mifos.dto.domain.OriginalScheduleInfoDto in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountOriginalSchedule.
@RequestMapping(value = "/viewLoanAccountOriginalSchedule", method = RequestMethod.GET)
public ModelAndView showLoanAccountOriginalSchedule(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountOriginalSchedule", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
OriginalScheduleInfoDto originalScheduleInfoDto = loanAccountServiceFacade.retrieveOriginalLoanSchedule(globalAccountNum);
modelAndView.addObject("originalScheduleInfoDto", originalScheduleInfoDto);
// for mifostabletag
request.setAttribute("originalInstallments", originalScheduleInfoDto.getOriginalLoanScheduleInstallments());
this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
use of org.mifos.dto.domain.OriginalScheduleInfoDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveOriginalLoanSchedule.
@Override
public OriginalScheduleInfoDto retrieveOriginalLoanSchedule(String globalAccountNum) {
LoanBO loanBO = this.loanDao.findByGlobalAccountNum(globalAccountNum);
Integer accountId = loanBO.getAccountId();
try {
List<OriginalLoanScheduleEntity> loanScheduleEntities = loanBusinessService.retrieveOriginalLoanSchedule(accountId);
ArrayList<RepaymentScheduleInstallmentDto> repaymentScheduleInstallments = new ArrayList<RepaymentScheduleInstallmentDto>();
for (OriginalLoanScheduleEntity loanScheduleEntity : loanScheduleEntities) {
RepaymentScheduleInstallment repaymentScheduleInstallment = loanScheduleEntity.toDto();
RepaymentScheduleInstallmentDto installmentDto = new RepaymentScheduleInstallmentDto(repaymentScheduleInstallment.getInstallment(), repaymentScheduleInstallment.getPrincipal().toString(), repaymentScheduleInstallment.getInterest().toString(), repaymentScheduleInstallment.getFees().toString(), repaymentScheduleInstallment.getMiscFees().toString(), repaymentScheduleInstallment.getFeesWithMiscFee().toString(), repaymentScheduleInstallment.getMiscPenalty().toString(), repaymentScheduleInstallment.getTotal(), repaymentScheduleInstallment.getDueDate());
repaymentScheduleInstallments.add(installmentDto);
}
return new OriginalScheduleInfoDto(loanBO.getLoanAmount().toString(), loanBO.getDisbursementDate(), repaymentScheduleInstallments);
} catch (PersistenceException e) {
throw new MifosRuntimeException(e);
}
}
Aggregations