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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanSummaryData.java:
##########
@@ -236,44 +223,23 @@ public static LoanSummaryData 
withOnlyCurrencyData(CurrencyData currencyData) {
         return LoanSummaryData.builder().currency(currencyData).build();
     }
 
-    private static BigDecimal 
computeTotalAccruedDueInterestAmount(Collection<LoanSchedulePeriodData> 
periods) {
-        final LocalDate businessDate = DateUtils.getBusinessLocalDate();
-        return periods.stream().filter(period -> 
!period.getDownPaymentPeriod() && businessDate.isAfter(period.getDueDate()))
-                .map(period -> 
period.getTotalAccruedInterest()).reduce(BigDecimal.ZERO, BigDecimal::add);
-    }
-
-    private static BigDecimal 
computeTotalInterestPaidDueAmount(Collection<LoanSchedulePeriodData> periods) {
-        final LocalDate businessDate = DateUtils.getBusinessLocalDate();
+    private static BigDecimal 
computeTotalUnpaidPayableDueInterestAmount(Collection<LoanSchedulePeriodData> 
periods,
+            final LocalDate businessDate) {
         return periods.stream().filter(period -> 
!period.getDownPaymentPeriod() && businessDate.isAfter(period.getDueDate()))

Review Comment:
   It should also involve the period that are on due date as well, not just the 
ones that already past.



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