mohitsinha commented on a change in pull request #614: Stop creating 
unnecessary overdue charge when amount is 0.
URL: https://github.com/apache/fineract/pull/614#discussion_r301682948
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
 ##########
 @@ -2359,6 +2359,9 @@ public void applyOverdueChargesForLoan(final Long 
loanId, Collection<OverdueLoan
                     null, null, null, loanId, null, null, null, 
null,null,null);
             LoanOverdueDTO overdueDTO = 
applyChargeToOverdueLoanInstallment(loanId, overdueInstallment.getChargeId(),
                     overdueInstallment.getPeriodNumber(), command, loan, 
existingTransactionIds, existingReversedTransactionIds);
+            if(overdueDTO == null){
 
 Review comment:
   `applyChargeToOverdueLoanInstallment` is  creating a `LoanCharge` and 
returning `LoanOverdueDTO`. I want to avoid creating the 
`LoanOverdueInstallmentCharge` on certain conditions ( the amount is zero). As 
the function holds all the logic for loan charges and returns using a 
constructor, I had to `return null` to escape the logic of charge creation. 
   
   Hence the null pointer check is due to my code changes inside 
`applyChargeToOverdueLoanInstallment`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to