FINERACT-1981: pay-off transaction for progressive loans

This commit is contained in:
Kristof Jozsa
2024-08-22 13:17:30 +02:00
committed by Adam Saghy
parent 5ebd3429c6
commit 80f4627623
2 changed files with 19 additions and 3 deletions
@@ -264,10 +264,10 @@ public class ProgressiveLoanScheduleGenerator implements LoanScheduleGenerator {
log.debug("calculating prepayment amount till rest frequency date (Strategy B)");
OutstandingAmountsDTO outstandingAmounts = new OutstandingAmountsDTO(currency);
loan.getRepaymentScheduleInstallments().forEach(installment -> {
boolean isPayoffAfterInstallmentFrom = installment.getFromDate().isAfter(onDate);
boolean isPayoffBeforeInstallment = installment.getFromDate().isBefore(onDate);
outstandingAmounts.plusPrincipal(installment.getPrincipalOutstanding(currency));
if (!isPayoffAfterInstallmentFrom) {
if (isPayoffBeforeInstallment) {
outstandingAmounts.plusInterest(installment.getInterestOutstanding(currency));
} else {
log.debug("Payoff after installment {}, not counting interest", installment.getDueDate());