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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/transactionprocessor/impl/AdvancedPaymentScheduleTransactionProcessor.java:
##########
@@ -1540,12 +1549,12 @@ private boolean shouldUseEmiCalculation(TransactionCtx 
transactionCtx, LocalDate
         if (transactionCtx instanceof ProgressiveTransactionCtx 
progressiveTransactionCtx) {
             boolean hasActiveReAmortization = 
progressiveTransactionCtx.getAlreadyProcessedTransactions().stream()
                     .anyMatch(t -> t.getTypeOf().isReAmortize() && 
t.isNotReversed());
-            boolean hasActiveReAge = 
progressiveTransactionCtx.getAlreadyProcessedTransactions().stream()
-                    .anyMatch(t -> t.getTypeOf().isReAge() && 
t.isNotReversed());
+            boolean hasReAge = 
progressiveTransactionCtx.getReAgeInterestHandlingType() != null;
             if (hasActiveReAmortization) {
                 return false;
             } else {
-                return !hasActiveReAge || !DateUtils.isAfter(transactionDate, 
progressiveTransactionCtx.getModel().getMaturityDate());
+                return !hasReAge || !(DateUtils.isAfter(transactionDate, 
progressiveTransactionCtx.getModel().getMaturityDate())
+                        || 
!keepUsingEmiCalculatorBasedOnReAge(progressiveTransactionCtx));

Review Comment:
   I believe below is equivalent:
   ```
   return !hasReAge || (!DateUtils.isAfter(transactionDate, 
progressiveTransactionCtx.getModel().getMaturityDate())
                           && 
keepUsingEmiCalculatorBasedOnReAge(progressiveTransactionCtx));
              



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