Dhanno98 commented on code in PR #5940:
URL: https://github.com/apache/fineract/pull/5940#discussion_r3454214957


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanChargeService.java:
##########
@@ -822,9 +828,9 @@ private void update(final LoanCharge loanCharge, final 
BigDecimal amount, final
                         if (numberOfRepayments == null) {
                             numberOfRepayments = 
loanCharge.getLoan().fetchNumberOfInstallmentsAfterExceptions();
                         }
-                        
loanCharge.setAmount(amount.multiply(BigDecimal.valueOf(numberOfRepayments)));
+                        
loanCharge.setAmount(loanCharge.minimumAndMaximumCap(amount.multiply(BigDecimal.valueOf(numberOfRepayments))));

Review Comment:
   You're right. I originally reused minimumAndMaximumCap() because 
percentage-based charges already passed through that path and received 
currency-based rounding there. However, that couples rounding with cap 
enforcement. I've removed the call from the flat charge flow and now perform 
the rounding directly during flat charge amount calculation.



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