adamsaghy commented on code in PR #6457:
URL: https://github.com/apache/fineract/pull/6457#discussion_r4064486181
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java:
##########
@@ -1307,18 +1307,19 @@ private WorkingCapitalLoanTransaction
reverseDisbursementTransactionAndResetBala
final List<WorkingCapitalLoanTransaction> accrualsToReverse =
transactions.stream()
.filter(t -> t.getTypeOf() == LoanTransactionType.ACCRUAL &&
!t.isReversed()).toList();
- transactions.forEach(this::markReversed);
-
- if
(loan.getLoanProduct().getAccountingRule().isAccrualWithDeferredRevenueAmortization())
{
- accountingProcessor.postReversalJournalEntries(loan, txn);
- }
+ transactions.stream().filter(t -> !t.isReversed()) // reverse only
unreversed transaction
+ .peek(this::markReversed) // mark them reversed
+ .forEach(t -> { // post journal entries if accounting is
enabled
+ if
(loan.getLoanProduct().getAccountingRule().isAccrualWithDeferredRevenueAmortization())
{
Review Comment:
Lets swap this:
`accountingProcessor` should check whether accounting is enabled or not...
we should always call it but internally decides whether to do anything or NO-OP
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]