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


##########
fineract-core/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransactionDataSummaryWrapper.java:
##########
@@ -142,4 +142,15 @@ public BigDecimal 
calculateTotalWithholdTaxWithdrawal(CurrencyData currency, Lis
         }
         return total.getAmountDefaultedToNullIfZero();
     }
+
+    public BigDecimal calculateTotalInterestAccrued(CurrencyData currency, 
List<SavingsAccountTransactionData> transactions) {
+        Money total = Money.zero(currency);
+        for (final SavingsAccountTransactionData transaction : transactions) {
+            if (transaction.isAccrual() && 
!transaction.isReversalTransaction()) {
+                total = total.plus(transaction.getAmount());

Review Comment:
   THis will be incorrect the moment accrual will be done for fee and penalties 
as well. I think we should immediately use the interest portion here, instead 
of the transaction amount.



-- 
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-unsubscr...@fineract.apache.org

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

Reply via email to