use of org.mifos.dto.screen.AccountPaymentDto in project head by mifos.
the class ViewCustomerDetailsController method showLastPaymentReceipt.
@RequestMapping(value = "/printClientPaymentReceipt", method = RequestMethod.GET)
public ModelAndView showLastPaymentReceipt(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) String globalAccountNum) {
ModelAndView modelAndView = new ModelAndView("printClientPaymentReceipt");
String gan = null;
if (globalAccountNum == null) {
gan = request.getSession().getAttribute("globalAccountNum").toString();
} else {
gan = globalAccountNum;
}
String clientSystemId = request.getParameter("globalCustNum");
AccountPaymentDto clientAccountPayment = clientServiceFacade.getClientAccountPayments(gan).get(0);
List<AdminDocumentDto> adminDocuments = adminDocumentsServiceFacade.getAdminDocumentsForAccountPayment(clientAccountPayment.getPaymentId());
if (adminDocuments != null && !adminDocuments.isEmpty()) {
clientAccountPayment.setAdminDocuments(adminDocuments);
}
modelAndView.addObject("clientAccountPayment", clientAccountPayment);
modelAndView.addObject("globalAccountNum", gan);
modelAndView.addObject("clientSystemId", clientSystemId);
return modelAndView;
}
use of org.mifos.dto.screen.AccountPaymentDto in project head by mifos.
the class ClientServiceFacadeWebTier method getClientAccountPayments.
@Override
public List<AccountPaymentDto> getClientAccountPayments(String globalAccountNum) {
List<AccountPaymentDto> clientAccountPayments = new ArrayList<AccountPaymentDto>();
try {
AccountBO account = legacyAccountDao.findBySystemId(globalAccountNum);
List<AccountPaymentEntity> clientAccountPaymentsEntities = account.getAccountPayments();
for (AccountPaymentEntity accountPaymentEntity : clientAccountPaymentsEntities) {
clientAccountPayments.add(accountPaymentEntity.toScreenDto());
}
} catch (PersistenceException e) {
throw new MifosRuntimeException(e);
}
return clientAccountPayments;
}
use of org.mifos.dto.screen.AccountPaymentDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method getLoanAccountPayments.
@Override
public List<AccountPaymentDto> getLoanAccountPayments(String globalAccountNum) {
List<AccountPaymentDto> loanAccountPayments = new ArrayList<AccountPaymentDto>();
LoanBO loanAccount = loanDao.findByGlobalAccountNum(globalAccountNum);
List<AccountPaymentEntity> loanAccountPaymentsEntities = loanAccount.getAccountPayments();
for (AccountPaymentEntity accountPaymentEntity : loanAccountPaymentsEntities) {
loanAccountPayments.add(accountPaymentEntity.toScreenDto());
}
//for new group loan accounts
if (loanAccount.isGroupLoanAccount() && null == loanAccount.getParentAccount()) {
for (LoanBO member : loanAccount.getMemberAccounts()) {
for (AccountPaymentEntity accPayment : member.getAccountPayments()) {
if (!accPayment.isLoanDisbursment()) {
loanAccountPayments.add(accPayment.toScreenDto());
}
}
}
Collections.sort(loanAccountPayments, new AccountPaymentDtoComperator());
Collections.reverse(loanAccountPayments);
}
return loanAccountPayments;
}
use of org.mifos.dto.screen.AccountPaymentDto in project head by mifos.
the class ViewLoanAccountDetailsController method showLastPaymentReceipt.
@RequestMapping(value = "/printPaymentReceipt", method = RequestMethod.GET)
public ModelAndView showLastPaymentReceipt(HttpServletRequest request, HttpServletResponse response, @RequestParam(required = false) String globalAccountNum) {
ModelAndView modelAndView = new ModelAndView("printPaymentReceipt");
String gan = null;
if (globalAccountNum == null) {
gan = request.getSession().getAttribute("globalAccountNum").toString();
} else {
gan = globalAccountNum;
}
AccountPaymentDto loanAccountPayment = loanAccountServiceFacade.getLoanAccountPayments(gan).get(0);
if (loanAccountServiceFacade.getGroupLoanType(gan).equals(GROUP_LOAN_PARENT)) {
Integer accountId = loanAccountServiceFacade.retrieveLoanInformation(gan).getAccountId();
List<AccountPaymentDto> loanAccountPayments = loanAccountServiceFacade.getLoanAccountPayments(gan);
for (AccountPaymentDto payment : loanAccountPayments) {
if (payment.getAccount().getAccountId() == accountId) {
loanAccountPayment = payment;
break;
}
}
}
List<AdminDocumentDto> adminDocuments = adminDocumentsServiceFacade.getAdminDocumentsForAccountPayment(loanAccountPayment.getPaymentId());
if (adminDocuments != null && !adminDocuments.isEmpty()) {
loanAccountPayment.setAdminDocuments(adminDocuments);
}
modelAndView.addObject("loanAccountPayment", loanAccountPayment);
modelAndView.addObject("globalAccountNum", gan);
return modelAndView;
}
use of org.mifos.dto.screen.AccountPaymentDto 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;
}
Aggregations