budaidev commented on code in PR #5100:
URL: https://github.com/apache/fineract/pull/5100#discussion_r2430071944


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/delinquency/service/LoanDelinquencyDomainServiceImpl.java:
##########
@@ -200,31 +203,27 @@ public LoanDelinquencyData getLoanDelinquencyData(final 
Loan loan, List<LoanDeli
         log.debug("Loan id {} with overdue since date {} and outstanding 
amount {}", loan.getId(), overdueSinceDate, outstandingAmount);
 
         long overdueDays = 0L;
+        Long pausedDays = 0L;
         if (overdueSinceDate != null) {
             overdueDays = DateUtils.getDifferenceInDays(overdueSinceDate, 
businessDate);
             if (overdueDays < 0) {
                 overdueDays = 0L;
             }
             collectionData.setPastDueDays(overdueDays);
+            pausedDays = 
delinquencyEffectivePauseHelper.getPausedDaysBeforeDate(effectiveDelinquencyList,
 businessDate);
             overdueSinceDate = 
overdueSinceDate.plusDays(graceDays.longValue());
             collectionData.setDelinquentDate(overdueSinceDate);
         }
         collectionData.setDelinquentAmount(outstandingAmount);
         collectionData.setDelinquentDays(0L);
         final long delinquentDays = overdueDays - graceDays;
         if (delinquentDays > 0) {
-            calculateDelinquentDays(effectiveDelinquencyList, businessDate, 
collectionData, delinquentDays);
+            Long calculatedDelinquentDays = delinquentDays - pausedDays;

Review Comment:
   Good point! I tried to keep the changes minimal, but a refactor like this 
certainly makes sense



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