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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanCharge.java:
##########
@@ -320,32 +320,24 @@ public static BigDecimal percentageOf(final BigDecimal 
value, final BigDecimal p
     }
 
     /**
-     * @param percentageOf
-     * @returns a minimum cap or maximum cap set on charges if the criteria 
fits else it returns the percentageOf if the
-     *          amount is within min and max cap
+     * @param value
+     * @returns a minimum cap or maximum cap set on charges if the criteria 
fits else it returns the value if the amount
+     *          is within min and max cap
      */
-    public BigDecimal minimumAndMaximumCap(final BigDecimal percentageOf) {
-        BigDecimal minMaxCap;
-        if (this.minCap != null) {
-            final int minimumCap = percentageOf.compareTo(this.minCap);
-            if (minimumCap == -1) {
-                minMaxCap = this.minCap;
-                return minMaxCap;
-            }
+    public BigDecimal minimumAndMaximumCap(final BigDecimal value) {

Review Comment:
   I intended to ensure all resulting charge amounts respected the currency 
precision rules, including values coming from min/max caps. However, I agree 
that minimumAndMaximumCap() should remain focused on cap enforcement and not be 
responsible for rounding. I've reverted the changes and moved the rounding 
logic to the charge amount calculation flow instead.



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