FINERACT-1724-Accrual-reversal-multiple-disbursement

This commit is contained in:
Ruchi Dhamankar
2023-05-09 22:00:05 +02:00
committed by Adam Saghy
parent 7f5b87694b
commit d15fc994e3
4 changed files with 370 additions and 6 deletions
@@ -1335,13 +1335,14 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
if (installment.getFeeChargesCharged(getCurrency()).isLessThan(fee)
|| installment.getInterestCharged(getCurrency()).isLessThan(interest)
|| installment.getPenaltyChargesCharged(getCurrency()).isLessThan(penality)
|| (getAccruedTill().isEqual(loanTransaction.getTransactionDate())
|| (isInterestBearing() && getAccruedTill().isEqual(loanTransaction.getTransactionDate())
&& !installment.getDueDate().isEqual(getAccruedTill()))) {
interest = interest.minus(loanTransaction.getInterestPortion(getCurrency()));
fee = fee.minus(loanTransaction.getFeeChargesPortion(getCurrency()));
penality = penality.minus(loanTransaction.getPenaltyChargesPortion(getCurrency()));
loanTransaction.reverse();
}
}
}
installment.updateAccrualPortion(interest, fee, penality);
@@ -5339,8 +5340,7 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
}
public boolean isInterestBearing() {
return getLoanRepaymentScheduleDetail().isInterestRecalculationEnabled()
&& BigDecimal.ZERO.compareTo(getLoanRepaymentScheduleDetail().getAnnualNominalInterestRate()) < 0;
return BigDecimal.ZERO.compareTo(getLoanRepaymentScheduleDetail().getAnnualNominalInterestRate()) < 0;
}
public LocalDate getExpectedMaturityDate() {