FINERACT-2221: Add immediate charge accrual post maturity for progressive loans
This commit is contained in:
committed by
Adam Saghy
parent
241906e042
commit
3687391148
+7
-3
@@ -1114,16 +1114,20 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
|
||||
// we want to apply charge transactions only for those loans charges that are applied when a loan is active and
|
||||
// the loan product uses Upfront Accruals, or only when the loan are closed too,
|
||||
if ((loan.getStatus().isActive() && loan.isNoneOrCashOrUpfrontAccrualAccountingEnabledOnLoanProduct())
|
||||
|| loan.getStatus().isOverpaid() || loan.getStatus().isClosedObligationsMet()
|
||||
|| (configurationDomainService.isImmediateChargeAccrualPostMaturityEnabled()
|
||||
&& DateUtils.getBusinessLocalDate().isAfter(loan.getMaturityDate()))) {
|
||||
|| loan.getStatus().isOverpaid() || loan.getStatus().isClosedObligationsMet()) {
|
||||
final LoanTransaction applyLoanChargeTransaction = loan.handleChargeAppliedTransaction(loanCharge, null);
|
||||
if (applyLoanChargeTransaction != null) {
|
||||
this.loanTransactionRepository.saveAndFlush(applyLoanChargeTransaction);
|
||||
businessEventNotifierService
|
||||
.notifyPostBusinessEvent(new LoanAccrualTransactionCreatedBusinessEvent(applyLoanChargeTransaction));
|
||||
}
|
||||
} else if (configurationDomainService.isImmediateChargeAccrualPostMaturityEnabled()
|
||||
&& DateUtils.getBusinessLocalDate().isAfter(loan.getMaturityDate())) {
|
||||
final LoanTransaction loanTransaction = loan.createChargeAppliedTransaction(loanCharge, null);
|
||||
this.loanTransactionRepository.saveAndFlush(loanTransaction);
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanAccrualTransactionCreatedBusinessEvent(loanTransaction));
|
||||
}
|
||||
|
||||
return DateUtils.isBeforeBusinessDate(loanCharge.getDueLocalDate());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user