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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -1305,11 +1305,11 @@ private void 
validateLoanTransactionAmountChargeBack(LoanTransaction loanTransac
         for (LoanTransactionRelation loanTransactionRelation : 
loanTransaction.getLoanTransactionRelations()) {
             if 
(loanTransactionRelation.getRelationType().equals(LoanTransactionRelationTypeEnum.CHARGEBACK)
                     && 
loanTransactionRelation.getToTransaction().isNotReversed()) {
-                actualAmount = 
actualAmount.add(loanTransactionRelation.getToTransaction().getPrincipalPortion());
+                actualAmount = 
actualAmount.add(loanTransactionRelation.getToTransaction().getAmount());
             }
         }
         actualAmount = actualAmount.add(chargebackTransaction.getAmount());
-        if (loanTransaction.getPrincipalPortion() != null && 
actualAmount.compareTo(loanTransaction.getPrincipalPortion()) > 0) {
+        if (loanTransaction.getAmount() != null && 
actualAmount.compareTo(loanTransaction.getAmount()) > 0) {

Review Comment:
   Please add an integration test for this change!



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