FINERACT-1971: Adding charge on a closed loan after maturity date should create an N+1 installment

This commit is contained in:
Adam Saghy
2023-10-05 08:22:09 +02:00
committed by Arnold Gálovics
parent be7c419b24
commit c89e7c3f46
2 changed files with 203 additions and 31 deletions
@@ -985,13 +985,7 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
}
}
LocalDate loanMaturityDate = loan.getExpectedMaturityDate();
if (loan.getMaturityDate() != null) {
loanMaturityDate = loan.getMaturityDate();
}
if (!loan.isInterestBearing() && loanCharge.isSpecifiedDueDate() && loanCharge.getDueDate().isAfter(loanMaturityDate)) {
if (!loan.isInterestBearing() && loanCharge.isSpecifiedDueDate()) {
LoanRepaymentScheduleInstallment latestRepaymentScheduleInstalment = loan.getRepaymentScheduleInstallments()
.get(loan.getLoanRepaymentScheduleInstallmentsSize() - 1);
if (loanCharge.getDueDate().isAfter(latestRepaymentScheduleInstalment.getDueDate())) {