Skip to content

Commit

Permalink
SU-530 (#1421)
Browse files Browse the repository at this point in the history
* SU-530 repayment schedule missalignement on rollback of transactions with grace period installments fixed
  • Loading branch information
faheem205 authored Dec 21, 2024
1 parent f8a6fae commit d5200b5
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,16 @@ private LoanScheduleModel generate(final MathContext mc, final LoanApplicationTe
Money outstandingBalance = scheduleParams.getOutstandingBalanceAsPerRest();
final int periodNumber = scheduleParams.getPeriodNumber();
Integer ignoreInstallment = loanApplicationTerms.getNumberOfInstallmentsToIgnore();
if (ignoreInstallment != null && ignoreInstallment < periodNumber) {
outstandingBalance = outstandingBalance.plus(cumulatingInterestPaymentDueToGrace);
cumulatingInterestPaymentDueToGrace = Money.zero(currency);
}
// SU-530 commenting below code for now because the implementation is not correct.
// 1. Grace interest should not be added to outstanding balance.
// 2. Implementation of checkbox on product level to calculate interest from disbursement date or from grace
// period end date is violated here
// because this check has never been implemented. For now cumulatingInterestPaymentDueToGrace should be 0
// if (ignoreInstallment != null && ignoreInstallment < periodNumber) {
// outstandingBalance = outstandingBalance.plus(cumulatingInterestPaymentDueToGrace);
// cumulatingInterestPaymentDueToGrace = Money.zero(currency);
// }
cumulatingInterestPaymentDueToGrace = Money.zero(currency);
final TreeMap<LocalDate, Money> principalVariation = mergeVariationsToMap(loanApplicationTerms, scheduleParams);
final Map<LocalDate, Money> compoundingMap = scheduleParams.getCompoundingMap();
final LocalDate periodEndDate = scheduledDueDate;
Expand Down Expand Up @@ -3128,8 +3134,9 @@ private LoanScheduleDTO rescheduleNextInstallmentsForProgressiveLoans(final Math
if (installment.isFullyGraced()) {
periods.add(createLoanScheduleModelDownPaymentPeriod(installment, outstandingBalance));
newRepaymentScheduleInstallments.add(installment);
actualRepaymentDate = getScheduledDateGenerator().generateNextRepaymentDate(actualRepaymentDate, loanApplicationTerms,
isFirstRepayment);
actualRepaymentDate = installment.getDueDate();
periodStartDate = installment.getDueDate();
periodNumber++;
continue;
}
if (installment.isDownPayment()) {
Expand Down

0 comments on commit d5200b5

Please sign in to comment.