FINERACT-1981: Reschedule loan with new repayment date (Progressive loan schedule)

This commit is contained in:
Adam Saghy
2023-11-07 16:48:10 +01:00
parent 436877d94b
commit 983f3d2da0
5 changed files with 191 additions and 23 deletions
@@ -5516,7 +5516,12 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
if (loanSchedule == null) {
return;
}
updateLoanSchedule(loanSchedule.getInstallments());
// Either the installments got recalculated or the model
if (loanSchedule.getInstallments() != null) {
updateLoanSchedule(loanSchedule.getInstallments());
} else {
updateLoanSchedule(loanSchedule.getLoanScheduleModel());
}
this.interestRecalculatedOn = DateUtils.getBusinessLocalDate();
LocalDate lastRepaymentDate = this.getLastRepaymentPeriodDueDate(true);
Set<LoanCharge> charges = this.getActiveCharges();