mariiaKraievska commented on code in PR #6417:
URL: https://github.com/apache/fineract/pull/6417#discussion_r3968648051


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculator.java:
##########
@@ -689,9 +689,18 @@ public Money 
getOutstandingLoanBalanceOfPeriod(ProgressiveLoanInterestScheduleMo
 
     @Override
     public OutstandingDetails 
getOutstandingAmountsTillDate(ProgressiveLoanInterestScheduleModel 
scheduleModel, LocalDate targetDate) {
+        return getOutstandingAmountsTillDate(scheduleModel, targetDate, false);
+    }
+
+    @Override
+    public OutstandingDetails 
getOutstandingAmountsTillDate(ProgressiveLoanInterestScheduleModel 
scheduleModel, LocalDate targetDate,
+            boolean fixedInterestTillDate) {
         MathContext mc = scheduleModel.mc();
         ProgressiveLoanInterestScheduleModel scheduleModelCopy = 
scheduleModel.deepCopy(mc);
         calculateRateFactorForScheduleTillDateInclusive(scheduleModelCopy, 
targetDate);
+        if (fixedInterestTillDate) {
+            scaleFixedInterestTillDate(scheduleModelCopy, targetDate);

Review Comment:
   scaleFixedInterestTillDate runs before 
calculateLastUnpaidRepaymentPeriodEMI, so fixedInterest is already mutated when 
the EMI-pass uses it as a floor (see ~1290–1292: paidPrincipal + fixedInterest).
   
   Maybe it will be better to move scaleFixedInterestTillDate after 
calculateLastUnpaidRepaymentPeriodEMI?



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