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_r306615088
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java
 ##########
 @@ -2490,6 +2493,9 @@ public LoanOverdueDTO 
applyChargeToOverdueLoanInstallment(final Long loanId, fin
 
                 final LoanCharge loanCharge = 
LoanCharge.createNewFromJson(loan, chargeDefinition, command, entry.getValue());
 
+                if (BigDecimal.ZERO.compareTo(loanCharge.amount()) == 0) {
+                    return null;
 
 Review comment:
   Currently we have only these types of `ChargeCalculationType`.
   ```    FLAT(1, "chargeCalculationType.flat"), //
       PERCENT_OF_AMOUNT(2, "chargeCalculationType.percent.of.amount"), //
       PERCENT_OF_AMOUNT_AND_INTEREST(3, 
"chargeCalculationType.percent.of.amount.and.interest"), //
       PERCENT_OF_INTEREST(4, "chargeCalculationType.percent.of.interest"),
       
PERCENT_OF_DISBURSEMENT_AMOUNT(5,"chargeCalculationType.percent.of.disbursement.amount");
   ```
   Even though it seems, that the amount can be different for a different 
iteration, in fact it is always the same. 

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