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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanproduct/calc/ProgressiveEMICalculator.java:
##########
@@ -1375,10 +1369,14 @@ private BigDecimal calculateRateFactorPerPeriod(final 
ProgressiveLoanInterestSch
         DaysInYearCustomStrategyType daysInYearCustomStrategy = 
loanProductRelatedDetail.getDaysInYearCustomStrategy();
         BigDecimal daysInYear = getNumberOfDays(daysInYearType, 
daysInYearCustomStrategy, interestPeriodFromDate,
                 repaymentPeriod.getFromDate(), repaymentPeriod.getDueDate());
-        final BigDecimal actualDaysInPeriod = BigDecimal
-                .valueOf(DateUtils.getDifferenceInDays(interestPeriodFromDate, 
interestPeriodDueDate));
         final BigDecimal calculatedDaysInRepaymentPeriod = BigDecimal
                 
.valueOf(DateUtils.getDifferenceInDays(repaymentPeriod.getFromDate(), 
repaymentPeriod.getDueDate()));
+        BigDecimal actualDaysInPeriod = 
BigDecimal.valueOf(DateUtils.getDifferenceInDays(interestPeriodFromDate, 
interestPeriodDueDate));
+        if (loanProductRelatedDetail.getInterestCalculationPeriodMethod() != 
null
+                && 
loanProductRelatedDetail.getInterestCalculationPeriodMethod().isSameAsRepaymentPeriod()
+                && 
!loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation()) {
+            actualDaysInPeriod = calculatedDaysInRepaymentPeriod;
+        }

Review Comment:
   I dont think this is relevant for the FINERACT-2155 story.
   
   Also I dont think this is correct either... Ratefactor is only from the 
interest period. It is independent from interest calculation period method. 
That should only control whether we are taking all the interest periods anyway 
or not, but not directly the sub interest period.



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