Merge branch 'Fineract-361' into develop
This commit is contained in:
+14
-3
@@ -633,7 +633,7 @@ public final class LoanApplicationTerms {
|
|||||||
// with periodic interest for default month and year for
|
// with periodic interest for default month and year for
|
||||||
// equal installment
|
// equal installment
|
||||||
final BigDecimal periodicInterestRateForRepaymentPeriod = periodicInterestRate(calculator, mc, DaysInMonthType.DAYS_30,
|
final BigDecimal periodicInterestRateForRepaymentPeriod = periodicInterestRate(calculator, mc, DaysInMonthType.DAYS_30,
|
||||||
DaysInYearType.DAYS_365, periodStartDate, periodEndDate);
|
DaysInYearType.DAYS_365, periodStartDate, periodEndDate, true);
|
||||||
Money totalPmtForThisInstallment = calculateTotalDueForEqualInstallmentRepaymentPeriod(periodicInterestRateForRepaymentPeriod,
|
Money totalPmtForThisInstallment = calculateTotalDueForEqualInstallmentRepaymentPeriod(periodicInterestRateForRepaymentPeriod,
|
||||||
outstandingBalance, periodsElapsed);
|
outstandingBalance, periodsElapsed);
|
||||||
return totalPmtForThisInstallment;
|
return totalPmtForThisInstallment;
|
||||||
@@ -966,7 +966,13 @@ public final class LoanApplicationTerms {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal periodicInterestRate(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc,
|
private BigDecimal periodicInterestRate(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc,
|
||||||
final DaysInMonthType daysInMonthType, final DaysInYearType daysInYearType, LocalDate periodStartDate, LocalDate periodEndDate) {
|
final DaysInMonthType daysInMonthType, final DaysInYearType daysInYearType, LocalDate periodStartDate,
|
||||||
|
LocalDate periodEndDate) {
|
||||||
|
return periodicInterestRate(calculator, mc, daysInMonthType, daysInYearType, periodStartDate, periodEndDate, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BigDecimal periodicInterestRate(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc, final DaysInMonthType daysInMonthType,
|
||||||
|
final DaysInYearType daysInYearType, LocalDate periodStartDate, LocalDate periodEndDate, boolean isForPMT) {
|
||||||
|
|
||||||
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
|
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
|
||||||
|
|
||||||
@@ -974,7 +980,12 @@ public final class LoanApplicationTerms {
|
|||||||
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
|
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
|
||||||
|
|
||||||
BigDecimal periodicInterestRate = BigDecimal.ZERO;
|
BigDecimal periodicInterestRate = BigDecimal.ZERO;
|
||||||
BigDecimal loanTermFrequencyBigDecimal = calculateLoanTermFrequency(periodStartDate, periodEndDate);
|
BigDecimal loanTermFrequencyBigDecimal = BigDecimal.ONE;
|
||||||
|
if(isForPMT){
|
||||||
|
loanTermFrequencyBigDecimal = BigDecimal.valueOf(this.repaymentEvery);
|
||||||
|
} else {
|
||||||
|
loanTermFrequencyBigDecimal = calculateLoanTermFrequency(periodStartDate, periodEndDate);
|
||||||
|
}
|
||||||
switch (this.interestCalculationPeriodMethod) {
|
switch (this.interestCalculationPeriodMethod) {
|
||||||
case INVALID:
|
case INVALID:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user