Aman-Mittal commented on code in PR #5219:
URL: https://github.com/apache/fineract/pull/5219#discussion_r2637200815


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/data/RepaymentPeriod.java:
##########
@@ -200,6 +200,19 @@ private BigDecimal calculateRateFactorPlus1() {
         return 
interestPeriods.stream().map(InterestPeriod::getRateFactor).reduce(BigDecimal.ONE,
 BigDecimal::add);
     }
 
+    /**
+     * This method gives back sum of (Rate Factor + 1) from interest periods 
that start on or after the given date. Used
+     * for Full Term Tranche calculations where a disbursement occurs 
mid-period.
+     *
+     * @param fromDate
+     *            the date from which to include interest periods
+     * @return rate factor plus 1 for filtered interest periods
+     */
+    public BigDecimal getRateFactorPlus1FromDate(LocalDate fromDate) {
+        return interestPeriods.stream().filter(ip -> 
!ip.getFromDate().isBefore(fromDate)).map(InterestPeriod::getRateFactor)
+                .reduce(BigDecimal.ONE, BigDecimal::add);
+    }

Review Comment:
   getRateFactorPlus1FromDate
   has implementation .reduce(BigDecimal.ONE, BigDecimal::add);
   
   



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