Cocoa-Puffs commented on code in PR #6440:
URL: https://github.com/apache/fineract/pull/6440#discussion_r4060020964


##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java:
##########
@@ -1365,7 +1367,9 @@ private void 
reverseDiscountFeeAmortizationAdjustments(final WorkingCapitalLoan
                 
LoanTransactionType.DISCOUNT_FEE_AMORTIZATION_ADJUSTMENT).forEach(relation -> {
                     final WorkingCapitalLoanTransaction txn = 
relation.getFromTransaction();
                     reverseTransaction(txn);
-                    accountingProcessor.postReversalJournalEntries(loan, txn);
+                    if 
(loan.getLoanProduct().getAccountingRule().isAccrualWithDeferredRevenueAmortization())
 {

Review Comment:
   We pass the loan itself to all public methods of the accounting processor. 
Shouldn't we make the accounting processor itself check the accounting rule of 
the loan it's receiving? There would be less chance to reintroduce this mistake 
in the future.



-- 
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]

Reply via email to