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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculator.java:
##########
@@ -845,10 +899,50 @@ private BigDecimal 
calculateRateFactorPerPeriodBasedOnRepaymentFrequency(final B
         };
     }
 
+    private void 
calculateEMIOnActualModelWithFlatInterestMethod(List<RepaymentPeriod> 
repaymentPeriods,
+            ProgressiveLoanInterestScheduleModel scheduleModel) {
+
+        final MathContext mc = scheduleModel.mc();
+        final CurrencyData currency = 
scheduleModel.loanProductRelatedDetail().getCurrencyData();
+        RepaymentPeriod first = repaymentPeriods.getFirst();
+        RepaymentPeriod last = repaymentPeriods.getLast();
+        Money sumOfInterest = Money.zero(currency);
+        for (RepaymentPeriod rp : repaymentPeriods) {
+            Money interest = rp.calculateCalculatedDueInterest();
+            sumOfInterest = sumOfInterest.add(interest);
+            rp.setEmi(interest);
+        }
+
+        // already repaid principals should be subtracted from total disbursed 
amount to calculate correct EMI.
+        BigDecimal alreadyRepaidPrincipals = first.getPrevious()

Review Comment:
   I am not sure, i understand this logic...
   



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