FINERACT-2148: Accrual handling in case of backdated Charged-off transaction
This commit is contained in:
committed by
Adam Saghy
parent
53c2cabf01
commit
02c66b180e
+10
@@ -3119,6 +3119,16 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
|
||||
this.noteRepository.save(note);
|
||||
}
|
||||
|
||||
loan.getLoanTransactions().stream().filter(LoanTransaction::isAccrual)
|
||||
.filter(transaction -> loan.getLoanProductRelatedDetail().isInterestRecognitionOnDisbursementDate()
|
||||
? !DateUtils.isBefore(transaction.getTransactionDate(), transactionDate)
|
||||
: DateUtils.isAfter(transaction.getTransactionDate(), transactionDate))
|
||||
.forEach(transaction -> {
|
||||
transaction.reverse();
|
||||
final LoanAdjustTransactionBusinessEvent.Data data = new LoanAdjustTransactionBusinessEvent.Data(transaction);
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanAdjustTransactionBusinessEvent(data));
|
||||
});
|
||||
|
||||
postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds);
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanChargeOffPostBusinessEvent(chargeOffTransaction));
|
||||
return new CommandProcessingResultBuilder() //
|
||||
|
||||
Reference in New Issue
Block a user