adamsaghy commented on code in PR #6106:
URL: https://github.com/apache/fineract/pull/6106#discussion_r3596987286
##########
fineract-accounting/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/service/WorkingCapitalLoanProductAdvancedAccountingReadHelper.java:
##########
@@ -74,20 +79,26 @@ public List<AdvancedMappingToExpenseAccountData>
fetchWriteOffReasonMappings(fin
}
private List<ChargeToGLAccountMapper> fetchChargeToIncomeMappings(final
Long wcLoanProductId, final boolean penalty) {
+ final int productType =
PortfolioProductType.WORKING_CAPITAL_LOAN.getValue();
final List<ProductToGLAccountMapping> mappings = penalty
- ?
productToGLAccountMappingRepository.findAllPenaltyMappings(wcLoanProductId,
- PortfolioProductType.WORKING_CAPITAL_LOAN.getValue())
- :
productToGLAccountMappingRepository.findAllFeeMappings(wcLoanProductId,
- PortfolioProductType.WORKING_CAPITAL_LOAN.getValue());
+ ?
productToGLAccountMappingRepository.findAllPenaltyToIncomeAccountMappings(wcLoanProductId,
productType)
+ :
productToGLAccountMappingRepository.findAllFeeToIncomeAccountMappings(wcLoanProductId,
productType);
+ if (mappings.isEmpty()) {
+ return null;
Review Comment:
is it safe to return `null`?
--
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]