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);
}
Aggregations