adamsaghy commented on code in PR #3366:
URL: https://github.com/apache/fineract/pull/3366#discussion_r1299818345
##########
fineract-loan/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/ProductToGLAccountMappingReadPlatformServiceImpl.java:
##########
@@ -233,41 +237,99 @@ public Map<String, Object>
fetchAccountMappingDetailsForSavingsProduct(final Lon
final List<Map<String, Object>> listOfProductToGLAccountMaps =
this.jdbcTemplate.query(sql, rm, // NOSONAR
new Object[] { PortfolioProductType.SAVING.getValue(),
savingsProductId });
- if (AccountingRuleType.CASH_BASED.getValue().equals(accountingType)) {
+ if (AccountingValidations.isCashBasedAccounting(accountingType)) {
for (final Map<String, Object> productToGLAccountMap :
listOfProductToGLAccountMaps) {
final Integer financialAccountType = (Integer)
productToGLAccountMap.get("financialAccountType");
- final CashAccountsForSavings glAccountForSavings =
CashAccountsForSavings.fromInt(financialAccountType);
+ CashAccountsForSavings glAccountForSavings =
CashAccountsForSavings.fromInt(financialAccountType);
+
+ if (glAccountForSavings != null) {
+ final Long glAccountId = (Long)
productToGLAccountMap.get("glAccountId");
Review Comment:
Please extract the common mappings. There are many duplicate codes here
--
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]