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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -3689,9 +3700,11 @@ private Money calculateTotalOverpayment() {
         }
 
         for (final LoanTransaction loanTransaction : this.loanTransactions) {
-            if ((loanTransaction.isRefund() || 
loanTransaction.isRefundForActiveLoan() || 
loanTransaction.isCreditBalanceRefund())
-                    && !loanTransaction.isReversed()) {
-                totalPaidInRepayments = 
totalPaidInRepayments.minus(loanTransaction.getAmount(currency));
+            if (!loanTransaction.isReversed()) {
+                if ((loanTransaction.isRefund() || 
loanTransaction.isRefundForActiveLoan() || 
loanTransaction.isCreditBalanceRefund()
+                        || loanTransaction.isChargeback())) {

Review Comment:
   I dont think this is right... Chargeback is kind of the opposite of refund. 
In my understanding when the customer gets refund it is like an opposite-way 
repayment, if the customer has $50 unpaid anything and in the event of $20 
refund, the remaining balance will be $30. However with chargeback we are not 
repaying any credit, we are increasing that.
   
   @josehernandezfintecheandomx What am I missing here?



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