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


##########
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())) {

Review Comment:
   Would it make sense use switch here instead and list all supported 
transaction type?
   Would it make sense to throw error if unsupported transaction type is found?



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