You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "adamsaghy (via GitHub)" <gi...@apache.org> on 2023/02/13 22:44:18 UTC

[GitHub] [fineract] adamsaghy commented on a diff in pull request #2972: FINERACT-1888-Full-Chargeback-For-Overpaid-Loan

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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org