Search in sources :

Example 6 with LoanAmountDetailsDto

use of org.mifos.dto.screen.LoanAmountDetailsDto in project head by mifos.

the class LoanProductFormBeanAssembler method translateToLoanAmountDetails.

private LoanAmountDetailsDto translateToLoanAmountDetails(LoanProductFormBean loanProductFormBean) {
    Integer calculationType = Integer.valueOf(loanProductFormBean.getSelectedLoanAmountCalculationType());
    MinMaxDefaultDto sameForAllLoanRange = null;
    List<LowerUpperMinMaxDefaultDto> byLastLoanAmountList = new ArrayList<LowerUpperMinMaxDefaultDto>();
    List<MinMaxDefaultDto> byLoanCycleList = new ArrayList<MinMaxDefaultDto>();
    if (Integer.valueOf(1).equals(calculationType)) {
        sameForAllLoanRange = translateSameForAllLoanBeanToMinMaxDefaultDto(loanProductFormBean.getLoanAmountSameForAllLoans());
    }
    if (Integer.valueOf(2).equals(calculationType)) {
        byLastLoanAmountList = translateByLastLoanAmountBeanToLowerUpperMinMaxDefaultDto(loanProductFormBean.getLoanAmountByLastLoanAmount());
    }
    if (Integer.valueOf(3).equals(calculationType)) {
        byLoanCycleList = translateLoanCycleBeanToMinMaxDefaultDto(loanProductFormBean.getLoanAmountByLoanCycle());
    }
    return new LoanAmountDetailsDto(calculationType, sameForAllLoanRange, byLastLoanAmountList, byLoanCycleList);
}
Also used : LoanAmountDetailsDto(org.mifos.dto.screen.LoanAmountDetailsDto) ArrayList(java.util.ArrayList) MinMaxDefaultDto(org.mifos.dto.domain.MinMaxDefaultDto) LowerUpperMinMaxDefaultDto(org.mifos.dto.domain.LowerUpperMinMaxDefaultDto) LowerUpperMinMaxDefaultDto(org.mifos.dto.domain.LowerUpperMinMaxDefaultDto)

Aggregations

LoanAmountDetailsDto (org.mifos.dto.screen.LoanAmountDetailsDto)6 ArrayList (java.util.ArrayList)4 LowerUpperMinMaxDefaultDto (org.mifos.dto.domain.LowerUpperMinMaxDefaultDto)4 MinMaxDefaultDto (org.mifos.dto.domain.MinMaxDefaultDto)4 ProductDetailsDto (org.mifos.dto.domain.ProductDetailsDto)3 RepaymentDetailsDto (org.mifos.dto.domain.RepaymentDetailsDto)3 LoanProductRequest (org.mifos.dto.domain.LoanProductRequest)2 AccountingDetailsDto (org.mifos.dto.screen.AccountingDetailsDto)2