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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -3893,6 +3893,23 @@ public ChangedTransactionDetail close(final JsonCommand 
command, final LoanLifec
         return changedTransactionDetail;
     }
 
+    public void handleChargebackTransaction(LoanTransaction 
chargebackTransaction,
+            final LoanLifecycleStateMachine loanLifecycleStateMachine) {
+        chargebackTransaction.updateLoan(this);
+
+        final LoanRepaymentScheduleTransactionProcessor 
loanRepaymentScheduleTransactionProcessor = this.transactionProcessorFactory
+                .determineProcessor(this.transactionProcessingStrategy);
+
+        
loanRepaymentScheduleTransactionProcessor.handleRefund(chargebackTransaction, 
getCurrency(), getRepaymentScheduleInstallments(),
+                charges());
+
+        if (isClosed()) {

Review Comment:
   This is not correct. As a side effect of the chargeback the loan can go from 
ACTIVE to OVERPAID



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