FINERACT-1981: Fix Charge Creation After Maturity Date on Interest Bearing Progressive Loan

This commit is contained in:
Soma Sörös
2024-11-18 15:04:35 +01:00
committed by Adam Saghy
parent 6e86ac853a
commit c9dc87f62a
3 changed files with 127 additions and 2 deletions
@@ -2446,7 +2446,8 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom<Long> {
}
}
if (reprocess) {
if (this.repaymentScheduleDetail().isInterestRecalculationEnabled()) {
if (this.repaymentScheduleDetail().isInterestRecalculationEnabled()
&& !getLoanProductRelatedDetail().getLoanScheduleType().equals(LoanScheduleType.PROGRESSIVE)) {
regenerateRepaymentScheduleWithInterestRecalculation(scheduleGeneratorDTO);
}
final List<LoanTransaction> allNonContraTransactionsPostDisbursement = retrieveListOfTransactionsForReprocessing();
@@ -46,7 +46,7 @@ public class SingleLoanChargeRepaymentScheduleProcessingWrapper {
totalPrincipal = totalPrincipal.plus(installment.getPrincipal(currency));
}
LoanChargePaidBy accrualBy = null;
if (!loan.isInterestBearing() && loanCharge.isSpecifiedDueDate()) { // TODO: why only if not interest bearing
if (loanCharge.isSpecifiedDueDate()) {
LoanRepaymentScheduleInstallment addedPeriod = addChargeOnlyRepaymentInstallmentIfRequired(loanCharge, installments);
if (addedPeriod != null) {
addedPeriod.updateObligationsMet(currency, disbursementDate);