use of org.mifos.dto.screen.MultipleLoanAccountDetailsDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveMultipleLoanAccountDetails.
@Override
public MultipleLoanAccountDetailsDto retrieveMultipleLoanAccountDetails(String searchId, Short branchId, Integer productId) {
List<ClientBO> clients = this.customerDao.findActiveClientsUnderParent(searchId, branchId);
if (clients.isEmpty()) {
throw new BusinessRuleException(LoanConstants.NOSEARCHRESULTS);
}
LoanOfferingBO loanOffering = this.loanProductDao.findById(productId);
// FIXME - Refactor MultipleLoanCreationDto into proper Dto
List<MultipleLoanCreationDto> multipleLoanDetails = buildClientViewHelper(loanOffering, clients);
List<ValueListElement> allLoanPruposes = this.loanProductDao.findAllLoanPurposes();
boolean loanPendingApprovalStateEnabled = ProcessFlowRules.isLoanPendingApprovalStateEnabled();
return new MultipleLoanAccountDetailsDto(allLoanPruposes, loanPendingApprovalStateEnabled);
}
use of org.mifos.dto.screen.MultipleLoanAccountDetailsDto in project head by mifos.
the class MultipleLoanAccountsCreationAction method get.
@TransactionDemarcate(joinToken = true)
public ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MultipleLoanAccountsCreationActionForm loanActionForm = (MultipleLoanAccountsCreationActionForm) form;
String searchId = loanActionForm.getCenterSearchId();
Short branchId = getShortValue(loanActionForm.getBranchOfficeId());
Integer productId = Integer.parseInt(loanActionForm.getPrdOfferingId());
MultipleLoanAccountDetailsDto multipleLoanDetails = this.loanAccountServiceFacade.retrieveMultipleLoanAccountDetails(searchId, branchId, productId);
List<ClientBO> clients = this.customerDao.findActiveClientsUnderParent(searchId, branchId);
if (clients.isEmpty()) {
throw new BusinessRuleException(LoanConstants.NOSEARCHRESULTS);
}
LoanOfferingBO loanOffering = this.loanProductDao.findById(productId);
List<MultipleLoanCreationDto> multipleLoanDetailsXX = buildClientViewHelper(loanOffering, clients);
loanActionForm.setClientDetails(multipleLoanDetailsXX);
SessionUtils.setAttribute(LoanConstants.LOANOFFERING, loanOffering, request);
SessionUtils.setCollectionAttribute(MasterConstants.BUSINESS_ACTIVITIES, multipleLoanDetails.getAllLoanPruposes(), request);
SessionUtils.setAttribute(CustomerConstants.PENDING_APPROVAL_DEFINED, multipleLoanDetails.isLoanPendingApprovalStateEnabled(), request);
return mapping.findForward(ActionForwards.get_success.toString());
}
Aggregations