loan term changes..
This commit is contained in:
@@ -27,6 +27,7 @@ public class LoanProductData {
|
|||||||
private BigDecimal interestRatePerPeriod = BigDecimal.ZERO;
|
private BigDecimal interestRatePerPeriod = BigDecimal.ZERO;
|
||||||
private BigDecimal annualInterestRate = BigDecimal.ZERO;
|
private BigDecimal annualInterestRate = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
private EnumOptionData loanTermFrequencyType;
|
||||||
private EnumOptionData repaymentFrequencyType;
|
private EnumOptionData repaymentFrequencyType;
|
||||||
private EnumOptionData interestRateFrequencyType;
|
private EnumOptionData interestRateFrequencyType;
|
||||||
private EnumOptionData amortizationType;
|
private EnumOptionData amortizationType;
|
||||||
@@ -44,6 +45,7 @@ public class LoanProductData {
|
|||||||
private List<EnumOptionData> interestCalculationPeriodTypeOptions = new ArrayList<EnumOptionData>();
|
private List<EnumOptionData> interestCalculationPeriodTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
private List<EnumOptionData> repaymentFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
private List<EnumOptionData> repaymentFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
private List<EnumOptionData> interestRateFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
private List<EnumOptionData> interestRateFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
private List<EnumOptionData> loanTermFrequencyTypeOptions = new ArrayList<EnumOptionData>();
|
||||||
|
|
||||||
public LoanProductData() {
|
public LoanProductData() {
|
||||||
//
|
//
|
||||||
@@ -54,6 +56,7 @@ public class LoanProductData {
|
|||||||
MoneyData tolerance, Integer numberOfRepayments,
|
MoneyData tolerance, Integer numberOfRepayments,
|
||||||
Integer repaymentEvery, BigDecimal interestRatePerPeriod,
|
Integer repaymentEvery, BigDecimal interestRatePerPeriod,
|
||||||
BigDecimal annualInterestRate,
|
BigDecimal annualInterestRate,
|
||||||
|
EnumOptionData loanTermFrequencyType,
|
||||||
EnumOptionData repaymentFrequencyType,
|
EnumOptionData repaymentFrequencyType,
|
||||||
EnumOptionData interestRateFrequencyType,
|
EnumOptionData interestRateFrequencyType,
|
||||||
EnumOptionData amortizationType, EnumOptionData interestType,
|
EnumOptionData amortizationType, EnumOptionData interestType,
|
||||||
@@ -70,6 +73,7 @@ public class LoanProductData {
|
|||||||
this.repaymentEvery = repaymentEvery;
|
this.repaymentEvery = repaymentEvery;
|
||||||
this.interestRatePerPeriod = interestRatePerPeriod;
|
this.interestRatePerPeriod = interestRatePerPeriod;
|
||||||
this.annualInterestRate = annualInterestRate;
|
this.annualInterestRate = annualInterestRate;
|
||||||
|
this.loanTermFrequencyType = loanTermFrequencyType;
|
||||||
this.repaymentFrequencyType = repaymentFrequencyType;
|
this.repaymentFrequencyType = repaymentFrequencyType;
|
||||||
this.interestRateFrequencyType = interestRateFrequencyType;
|
this.interestRateFrequencyType = interestRateFrequencyType;
|
||||||
this.amortizationType = amortizationType;
|
this.amortizationType = amortizationType;
|
||||||
@@ -262,6 +266,23 @@ public class LoanProductData {
|
|||||||
this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions;
|
this.interestRateFrequencyTypeOptions = interestRateFrequencyTypeOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EnumOptionData getLoanTermFrequencyType() {
|
||||||
|
return loanTermFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanTermFrequencyType(EnumOptionData loanTermFrequencyType) {
|
||||||
|
this.loanTermFrequencyType = loanTermFrequencyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EnumOptionData> getLoanTermFrequencyTypeOptions() {
|
||||||
|
return loanTermFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoanTermFrequencyTypeOptions(
|
||||||
|
List<EnumOptionData> loanTermFrequencyTypeOptions) {
|
||||||
|
this.loanTermFrequencyTypeOptions = loanTermFrequencyTypeOptions;
|
||||||
|
}
|
||||||
|
|
||||||
public List<CurrencyData> getCurrencyOptions() {
|
public List<CurrencyData> getCurrencyOptions() {
|
||||||
return currencyOptions;
|
return currencyOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -1,7 +1,11 @@
|
|||||||
package org.mifosng.platform.loan.domain;
|
package org.mifosng.platform.loan.domain;
|
||||||
|
|
||||||
public enum PeriodFrequencyType {
|
public enum PeriodFrequencyType {
|
||||||
DAYS(0, "periodFrequencyType.days"), WEEKS(1, "periodFrequencyType.weeks"), MONTHS(2, "periodFrequencyType.months"), YEARS(3, "periodFrequencyType.years"), INVALID(4, "periodFrequencyType.invalid");
|
DAYS(0, "periodFrequencyType.days"), //
|
||||||
|
WEEKS(1, "periodFrequencyType.weeks"), //
|
||||||
|
MONTHS(2, "periodFrequencyType.months"), //
|
||||||
|
YEARS(3, "periodFrequencyType.years"), //
|
||||||
|
INVALID(4, "periodFrequencyType.invalid");
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
+27
@@ -9,6 +9,33 @@ import org.mifosng.platform.loan.domain.PeriodFrequencyType;
|
|||||||
|
|
||||||
public class LoanEnumerations {
|
public class LoanEnumerations {
|
||||||
|
|
||||||
|
public static EnumOptionData loanTermFrequencyType(final int id) {
|
||||||
|
return loanTermFrequencyType(PeriodFrequencyType.fromInt(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumOptionData loanTermFrequencyType(final PeriodFrequencyType type) {
|
||||||
|
final String codePrefix = "loanTermFrequency.";
|
||||||
|
EnumOptionData optionData = null;
|
||||||
|
switch (type) {
|
||||||
|
case DAYS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.DAYS.getValue().longValue(), codePrefix + PeriodFrequencyType.DAYS.getCode(), "Days");
|
||||||
|
break;
|
||||||
|
case WEEKS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.WEEKS.getValue().longValue(), codePrefix + PeriodFrequencyType.WEEKS.getCode(), "Weeks");
|
||||||
|
break;
|
||||||
|
case MONTHS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.MONTHS.getValue().longValue(), codePrefix + PeriodFrequencyType.MONTHS.getCode(), "Months");
|
||||||
|
break;
|
||||||
|
case YEARS:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.YEARS.getValue().longValue(), codePrefix + PeriodFrequencyType.YEARS.getCode(), "Years");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
optionData = new EnumOptionData(PeriodFrequencyType.INVALID.getValue().longValue(), PeriodFrequencyType.INVALID.getCode(), "Invalid");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return optionData;
|
||||||
|
}
|
||||||
|
|
||||||
public static EnumOptionData repaymentFrequencyType(final int id) {
|
public static EnumOptionData repaymentFrequencyType(final int id) {
|
||||||
return repaymentFrequencyType(PeriodFrequencyType.fromInt(id));
|
return repaymentFrequencyType(PeriodFrequencyType.fromInt(id));
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-13
@@ -31,8 +31,7 @@ import org.springframework.jdbc.core.RowMapper;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LoanProductReadPlatformServiceImpl implements
|
public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatformService {
|
||||||
LoanProductReadPlatformService {
|
|
||||||
|
|
||||||
private final PlatformSecurityContext context;
|
private final PlatformSecurityContext context;
|
||||||
private final CurrencyReadPlatformService currencyReadPlatformService;
|
private final CurrencyReadPlatformService currencyReadPlatformService;
|
||||||
@@ -188,24 +187,21 @@ public class LoanProductReadPlatformServiceImpl implements
|
|||||||
BigDecimal annualInterestRate = rs
|
BigDecimal annualInterestRate = rs
|
||||||
.getBigDecimal("annualInterestRate");
|
.getBigDecimal("annualInterestRate");
|
||||||
|
|
||||||
int repaymentFrequencyTypeId = JdbcSupport.getInteger(rs,
|
int repaymentFrequencyTypeId = JdbcSupport.getInteger(rs, "repaymentPeriodFrequency");
|
||||||
"repaymentPeriodFrequency");
|
EnumOptionData repaymentFrequencyType = LoanEnumerations.repaymentFrequencyType(repaymentFrequencyTypeId);
|
||||||
EnumOptionData repaymentFrequencyType = LoanEnumerations
|
|
||||||
.repaymentFrequencyType(repaymentFrequencyTypeId);
|
EnumOptionData loanTermFrequencyType = LoanEnumerations.loanTermFrequencyType(repaymentFrequencyTypeId);
|
||||||
|
|
||||||
int amortizationTypeId = JdbcSupport.getInteger(rs,
|
int amortizationTypeId = JdbcSupport.getInteger(rs,
|
||||||
"amortizationMethod");
|
"amortizationMethod");
|
||||||
EnumOptionData amortizationType = LoanEnumerations
|
EnumOptionData amortizationType = LoanEnumerations
|
||||||
.amortizationType(amortizationTypeId);
|
.amortizationType(amortizationTypeId);
|
||||||
|
|
||||||
int interestRateFrequencyTypeId = JdbcSupport.getInteger(rs,
|
int interestRateFrequencyTypeId = JdbcSupport.getInteger(rs,"interestRatePerPeriodFreq");
|
||||||
"interestRatePerPeriodFreq");
|
EnumOptionData interestRateFrequencyType = LoanEnumerations.interestRateFrequencyType(interestRateFrequencyTypeId);
|
||||||
EnumOptionData interestRateFrequencyType = LoanEnumerations
|
|
||||||
.interestRateFrequencyType(interestRateFrequencyTypeId);
|
|
||||||
|
|
||||||
int interestTypeId = JdbcSupport.getInteger(rs, "interestMethod");
|
int interestTypeId = JdbcSupport.getInteger(rs, "interestMethod");
|
||||||
EnumOptionData interestType = LoanEnumerations
|
EnumOptionData interestType = LoanEnumerations.interestType(interestTypeId);
|
||||||
.interestType(interestTypeId);
|
|
||||||
|
|
||||||
int interestCalculationPeriodTypeId = JdbcSupport.getInteger(rs,
|
int interestCalculationPeriodTypeId = JdbcSupport.getInteger(rs,
|
||||||
"interestCalculationInPeriodMethod");
|
"interestCalculationInPeriodMethod");
|
||||||
@@ -218,7 +214,7 @@ public class LoanProductReadPlatformServiceImpl implements
|
|||||||
return new LoanProductData(createdOn, lastModifedOn, id, name,
|
return new LoanProductData(createdOn, lastModifedOn, id, name,
|
||||||
description, principalMoney, toleranceMoney,
|
description, principalMoney, toleranceMoney,
|
||||||
numberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
numberOfRepayments, repaymentEvery, interestRatePerPeriod,
|
||||||
annualInterestRate, repaymentFrequencyType,
|
annualInterestRate, loanTermFrequencyType, repaymentFrequencyType,
|
||||||
interestRateFrequencyType, amortizationType, interestType,
|
interestRateFrequencyType, amortizationType, interestType,
|
||||||
interestCalculationPeriodType, fundId, fundName, transactionStrategyId, transactionStrategyName);
|
interestCalculationPeriodType, fundId, fundName, transactionStrategyId, transactionStrategyName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user