Search in sources :

Example 6 with AdminDocumentDto

use of org.mifos.dto.domain.AdminDocumentDto in project head by mifos.

the class ViewLoanAccountDetailsController method showLoanAccountPayments.

@RequestMapping(value = "/viewLoanAccountPayments", method = RequestMethod.GET)
public ModelAndView showLoanAccountPayments(HttpServletRequest request, HttpServletResponse response, @RequestParam String globalAccountNum) {
    ModelAndView modelAndView = new ModelAndView("viewLoanAccountPayments");
    List<AccountPaymentDto> loanAccountPayments = loanAccountServiceFacade.getLoanAccountPayments(globalAccountNum);
    for (AccountPaymentDto accountPaymentDto : loanAccountPayments) {
        List<AdminDocumentDto> adminDocuments = adminDocumentsServiceFacade.getAdminDocumentsForAccountPayment(accountPaymentDto.getPaymentId());
        if (adminDocuments != null && !adminDocuments.isEmpty()) {
            accountPaymentDto.setAdminDocuments(adminDocuments);
        }
    }
    modelAndView.addObject("loanType", loanAccountServiceFacade.getGroupLoanType(globalAccountNum));
    modelAndView.addObject("loanAccountPayments", loanAccountPayments);
    return modelAndView;
}
Also used : ModelAndView(org.springframework.web.servlet.ModelAndView) AdminDocumentDto(org.mifos.dto.domain.AdminDocumentDto) AccountPaymentDto(org.mifos.dto.screen.AccountPaymentDto) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

AdminDocumentDto (org.mifos.dto.domain.AdminDocumentDto)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 ModelAndView (org.springframework.web.servlet.ModelAndView)4 AccountPaymentDto (org.mifos.dto.screen.AccountPaymentDto)3 ArrayList (java.util.ArrayList)2 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)1 AccountTrxnEntity (org.mifos.accounts.business.AccountTrxnEntity)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 PersistenceException (org.mifos.framework.exceptions.PersistenceException)1 AdminDocumentBO (org.mifos.reports.admindocuments.business.AdminDocumentBO)1