adamsaghy commented on code in PR #5206:
URL: https://github.com/apache/fineract/pull/5206#discussion_r2598803159


##########
fineract-core/src/main/java/org/apache/fineract/organisation/monetary/domain/Money.java:
##########
@@ -165,6 +165,9 @@ public static Money roundToMultiplesOf(final Money 
existingVal, final Integer in
         BigDecimal inMultiplesOfValue = BigDecimal.valueOf(inMultiplesOf);
         if (inMultiplesOfValue.compareTo(BigDecimal.ZERO) > 0) {
             amountScaled = amountScaled.divide(inMultiplesOfValue, 0, 
mc.getRoundingMode()).multiply(inMultiplesOfValue);
+            if (amountScaled.compareTo(BigDecimal.ZERO) == 0 && 
!existingVal.isZero()) {

Review Comment:
   Scaled to 0 might be valid in some cases. i dont think we should be clever 
on this level, but rather on the repayment schedule wise (last installment 
balances or something...)



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