Search in sources :

Example 1 with MultipleLoanAccountDetailsDto

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);
}
Also used : BusinessRuleException(org.mifos.service.BusinessRuleException) MultipleLoanAccountDetailsDto(org.mifos.dto.screen.MultipleLoanAccountDetailsDto) ClientBO(org.mifos.customers.client.business.ClientBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) MultipleLoanCreationDto(org.mifos.accounts.loan.util.helpers.MultipleLoanCreationDto) ValueListElement(org.mifos.dto.domain.ValueListElement)

Example 2 with MultipleLoanAccountDetailsDto

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());
}
Also used : BusinessRuleException(org.mifos.service.BusinessRuleException) MultipleLoanAccountDetailsDto(org.mifos.dto.screen.MultipleLoanAccountDetailsDto) ClientBO(org.mifos.customers.client.business.ClientBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) MultipleLoanCreationDto(org.mifos.accounts.loan.util.helpers.MultipleLoanCreationDto) MultipleLoanAccountsCreationActionForm(org.mifos.accounts.loan.struts.actionforms.MultipleLoanAccountsCreationActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

MultipleLoanCreationDto (org.mifos.accounts.loan.util.helpers.MultipleLoanCreationDto)2 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)2 ClientBO (org.mifos.customers.client.business.ClientBO)2 MultipleLoanAccountDetailsDto (org.mifos.dto.screen.MultipleLoanAccountDetailsDto)2 BusinessRuleException (org.mifos.service.BusinessRuleException)2 MultipleLoanAccountsCreationActionForm (org.mifos.accounts.loan.struts.actionforms.MultipleLoanAccountsCreationActionForm)1 ValueListElement (org.mifos.dto.domain.ValueListElement)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1