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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculator.java:
##########
@@ -327,19 +390,20 @@ private void 
calculateLastUnpaidRepaymentPeriodEMI(ProgressiveLoanInterestSchedu
         MathContext mc = scheduleModel.mc();
         Money totalDueInterest = 
scheduleModel.repaymentPeriods().stream().map(RepaymentPeriod::getDueInterest).reduce(scheduleModel.zero(),
                 (m1, m2) -> m1.plus(m2, mc)); // 1.46
-        Money totalEMI = 
scheduleModel.repaymentPeriods().stream().map(RepaymentPeriod::getEmi).reduce(scheduleModel.zero(),
+        Money totalEMI = 
scheduleModel.repaymentPeriods().stream().map(RepaymentPeriod::getCalculatedEmi).reduce(scheduleModel.zero(),
                 (m1, m2) -> m1.plus(m2, mc)); // 101.48
         Money totalDisbursedAmount = scheduleModel.repaymentPeriods().stream()
                 .flatMap(rp -> 
rp.getInterestPeriods().stream().map(InterestPeriod::getDisbursementAmount))
-                .reduce(scheduleModel.zero(), (m1, m2) -> m1.plus(m2, mc)); // 
100
+                .reduce(scheduleModel.zero(), (m1, m2) -> m1.plus(m2, mc)) // 
100
+                .plus(scheduleModel.getTotalChargebackPrincipal(), mc); //

Review Comment:
   Can we separate disbursements amount and chargedback amounts? It might lead 
to misunderstandings...



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