Merge pull request #1309 from pramodn02/develop
MIFOSX-1884 : corrected principal moratorium
This commit is contained in:
+4
-8
@@ -349,15 +349,11 @@ public abstract class AbstractLoanScheduleGenerator implements LoanScheduleGener
|
||||
|
||||
totalOutstandingInterestPaymentDueToGrace = principalInterestForThisPeriod.interestPaymentDueToGrace();
|
||||
Money principalForThisPeriod = principalInterestForThisPeriod.principal();
|
||||
|
||||
if (loanApplicationTerms.getAmortizationMethod().isEqualInstallment() && loanApplicationTerms.getFixedEmiAmount() != null) {
|
||||
Money principalToBeAdjust = Money.of(currency, loanApplicationTerms.getFixedEmiAmount()).minus(principalForThisPeriod)
|
||||
.minus(interestForThisinstallment);
|
||||
principalForThisPeriod = principalForThisPeriod.plus(principalToBeAdjust);
|
||||
|
||||
if(principalForThisPeriod.isZero()){
|
||||
loanApplicationTerms.resetFixedEmiAmount();
|
||||
}
|
||||
principalForThisPeriod = loanApplicationTerms.adjustPrincipalIfLastRepaymentPeriod(principalForThisPeriod,
|
||||
totalCumulativePrincipal.plus(principalForThisPeriod), periodNumber);
|
||||
|
||||
|
||||
// applies early payments on principal portion
|
||||
if (principalForThisPeriod.isGreaterThan(reducePrincipal)) {
|
||||
principalForThisPeriod = principalForThisPeriod.minus(reducePrincipal);
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class DecliningBalanceInterestLoanScheduleGenerator extends AbstractLoanS
|
||||
// adjust if needed
|
||||
principalForThisInstallment = loanApplicationTerms.adjustPrincipalIfLastRepaymentPeriod(principalForThisInstallment,
|
||||
totalCumulativePrincipalToDate, periodNumber);
|
||||
|
||||
|
||||
return new PrincipalInterest(principalForThisInstallment, interestForThisInstallment, interestBroughtFowardDueToGrace);
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -349,7 +349,7 @@ public final class LoanApplicationTerms {
|
||||
// paid too much principal, subtract amount that overpays from
|
||||
// principal paid for period.
|
||||
adjusted = principalForPeriod.minus(totalPrincipalRemaining.abs());
|
||||
} else if (this.fixedEmiAmount != null) {
|
||||
} else if (this.actualFixedEmiAmount != null) {
|
||||
final Money difference = this.principal.minus(totalCumulativePrincipalToDate);
|
||||
final Money principalThreshold = principalForPeriod.multipliedBy(this.principalThresholdForLastInstalment).dividedBy(100,
|
||||
RoundingMode.HALF_EVEN);
|
||||
@@ -1016,8 +1016,10 @@ public final class LoanApplicationTerms {
|
||||
for (LoanTermVariationsData loanVariationTermsData : this.emiAmountVariations) {
|
||||
if (!periodDate.isBefore(loanVariationTermsData.getTermApplicableFrom())
|
||||
&& !startDate.isAfter(loanVariationTermsData.getTermApplicableFrom())) {
|
||||
this.fixedEmiAmount = loanVariationTermsData.getTermValue();
|
||||
startDate = loanVariationTermsData.getTermApplicableFrom();
|
||||
if (loanVariationTermsData.getTermValue() != null) {
|
||||
this.fixedEmiAmount = loanVariationTermsData.getTermValue();
|
||||
startDate = loanVariationTermsData.getTermApplicableFrom();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -783,7 +783,7 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
||||
* a fixed EMI, ensure the number of repayments is within the
|
||||
* permissible range defined by the loan product
|
||||
**/
|
||||
if (loan.loanProduct().isMultiDisburseLoan() && loan.getFixedEmiAmount() != null) {
|
||||
if (loan.getFixedEmiAmount() != null) {
|
||||
Integer minimumNoOfRepayments = loan.loanProduct().getMinNumberOfRepayments();
|
||||
Integer maximumNoOfRepayments = loan.loanProduct().getMaxNumberOfRepayments();
|
||||
Integer actualNumberOfRepayments = loan.getRepaymentScheduleInstallments().size();
|
||||
|
||||
Reference in New Issue
Block a user