adamsaghy commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3258755315


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForWorkingCapitalLoan.java:
##########
@@ -63,12 +65,27 @@ public void postJournalEntriesForRepayment(final 
WorkingCapitalLoan loan, final
         final BigDecimal overpaymentPortion = 
txn.getTransactionAmount().subtract(principalPortion).subtract(feesPortion)
                 .subtract(penaltiesPortion).max(BigDecimal.ZERO);
 
-        if (isChargedOff) {
-            postChargedOffRepaymentEntries(office, productId, currencyCode, 
transactionDate, paymentTypeId, txn, principalPortion,
-                    feesPortion, penaltiesPortion, overpaymentPortion);
-        } else {
-            postRegularRepaymentEntries(office, productId, currencyCode, 
transactionDate, paymentTypeId, txn, principalPortion, feesPortion,
-                    penaltiesPortion, overpaymentPortion);
+        if (LoanTransactionType.REPAYMENT.equals(txn.getTypeOf())) {
+            if (isChargedOff) {
+                postChargedOffRepaymentEntries(office, productId, 
currencyCode, transactionDate, paymentTypeId, txn, principalPortion,
+                        feesPortion, penaltiesPortion, overpaymentPortion);
+            } else {
+                postRegularRepaymentEntries(office, productId, currencyCode, 
transactionDate, paymentTypeId, txn, principalPortion,
+                        feesPortion, penaltiesPortion, overpaymentPortion);
+            }
+        }
+        if (LoanTransactionType.GOODWILL_CREDIT.equals(txn.getTypeOf()) && 
!isChargedOff) {

Review Comment:
   Would it make sense to handle these use cases, similarly as above repayment 
does?
   - Having condition whether need to create journal entries for non 
charged-off loan?
   - Having condition whether need to create journal entries for charged-off 
loan? -> unsupported yet...



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