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


##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -108,7 +108,7 @@ public WorkingCapitalLoanChargeData toData() {
     }
 
     public BigDecimal getAmountOutstanding() {
-        return getAmount().min(getAmountPaid());
+        return getAmount().subtract(getAmountPaid() != null ? getAmountPaid() 
: BigDecimal.ZERO).max(BigDecimal.ZERO);

Review Comment:
   MathUtil handles nullability of subtraction.. also, there should be no 
negative amount in any scenario... the max condition here would hide an 
issue... please remove it.



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