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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -1330,14 +1330,21 @@ private void updateLoanSummaryDerivedFields() {
             this.totalOverpaid = null;
         } else {
             final Money overpaidBy = calculateTotalOverpayment();
-            this.totalOverpaid = overpaidBy.getAmountDefaultedToNullIfZero();
+            this.totalOverpaid = null;
+            Money credits = Money.zero(getCurrency());
+            Money debits = Money.zero(getCurrency());
+            if (!overpaidBy.isLessThanZero()) {
+                this.totalOverpaid = 
overpaidBy.getAmountDefaultedToNullIfZero();
+            } else {
+                credits = overpaidBy.plus(getTotalChargebacks());

Review Comment:
   Can you please give me an example and some explanation to understand better 
the credits 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