vidakovic commented on code in PR #6106:
URL: https://github.com/apache/fineract/pull/6106#discussion_r3571031973


##########
fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/WorkingCapitalLoanProductAdvancedAccountingReadHelper.java:
##########
@@ -74,17 +79,26 @@ public List<AdvancedMappingToExpenseAccountData> 
fetchWriteOffReasonMappings(fin
     }
 
     private List<ChargeToGLAccountMapper> fetchChargeToIncomeMappings(final 
Long wcLoanProductId, final boolean penalty) {
-        final List<ProductToGLAccountMapping> mappings = penalty
-                ? 
productToGLAccountMappingRepository.findAllPenaltyMappings(wcLoanProductId,
-                        PortfolioProductType.WORKING_CAPITAL_LOAN.getValue())
-                : 
productToGLAccountMappingRepository.findAllFeeMappings(wcLoanProductId,
-                        PortfolioProductType.WORKING_CAPITAL_LOAN.getValue());
+        // The charge name lives on m_charge, not on ProductToGLAccountMapping 
(which only stores charge_id), and the
+        // accounting module is decoupled from the charge domain, so we read 
the charge -> income-account rows via
+        // JdbcTemplate rather than a JPA native query (EclipseLink does not 
bind Spring Data ":name" markers in native
+        // queries). Column order: [0] gl_account_id, [1] charge id, [2] 
charge name. The penalty flag is known from the
+        // method argument, so it is inlined as a boolean literal (never user 
input) rather than bound.

Review Comment:
   That would be a regression, agreed.



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