FINERACT-1724-Add-fee-paid-off-loan-with-refund

This commit is contained in:
Ruchi Dhamankar
2023-03-22 11:16:38 +01:00
committed by Adam Saghy
parent e46ec2c984
commit 6c12b76425
2 changed files with 165 additions and 1 deletions
@@ -981,7 +981,13 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
}
}
if (!loan.isInterestBearing() && loanCharge.isSpecifiedDueDate() && loanCharge.getDueDate().isAfter(loan.getMaturityDate())) {
LocalDate loanMaturityDate = loan.getExpectedMaturityDate();
if (loan.getMaturityDate() != null) {
loanMaturityDate = loan.getMaturityDate();
}
if (!loan.isInterestBearing() && loanCharge.isSpecifiedDueDate() && loanCharge.getDueDate().isAfter(loanMaturityDate)) {
LoanRepaymentScheduleInstallment latestRepaymentScheduleInstalment = loan.getRepaymentScheduleInstallments()
.get(loan.getLoanRepaymentScheduleInstallmentsSize() - 1);
if (loanCharge.getDueDate().isAfter(latestRepaymentScheduleInstalment.getDueDate())) {