galovics commented on code in PR #2550:
URL: https://github.com/apache/fineract/pull/2550#discussion_r959242664


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java:
##########
@@ -1689,18 +1689,20 @@ public LoanTermVariationsData mapRow(final ResultSet 
rs, @SuppressWarnings("unus
             return new LoanTermVariationsData(id, 
LoanEnumerations.loanVariationType(LoanTermVariationType.EMI_AMOUNT),
                     variationApplicableFrom, decimalValue, dateValue, 
isSpecificToInstallment);
         }
-
     }
 
     @Override
     public Collection<LoanScheduleDelinquencyData> 
retrieveScheduleDelinquencyData(LocalDate businessLocalDate) {
         LoanScheduleDelinquencyMapper mapper = new 
LoanScheduleDelinquencyMapper(DateUtils.getBusinessLocalDate());
         final StringBuilder sqlBuilder = new StringBuilder(400);
         sqlBuilder.append("select ").append(mapper.schema())
+                // Just get the overdued installments
                 .append(" where loan.loan_status_id=:active and ls.duedate <= 
:businessLocalDate and ")
-                .append(" mpl.delinquency_bucket_id is not null "); // Jusr 
the Loan Product linked to delinquency
-                                                                    // bucket
-        sqlBuilder.append(" order by loan.id, ls.duedate ");
+                // Just get the unpaid installments using the 
completed_derived flag
+                .append(" ls.completed_derived = false and ")

Review Comment:
   Probably I missed this during the original PR review but can you please 
explain why we need a native query here instead of JPQL/Criteria API/Spring 
Data repo?



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