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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java:
##########
@@ -1883,8 +1882,10 @@ public Collection<Long> 
fetchLoansForInterestRecalculation() {
     @Override
     public List<Long> fetchLoansForInterestRecalculation(Integer pageSize, 
Long maxLoanIdInList, String officeHierarchy) {
         LocalDate currentdate = DateUtils.getBusinessLocalDate();
-        // will look only for yesterday modified rates
-        LocalDate yesterday = DateUtils.getBusinessLocalDate().minusDays(1);
+        // will look only for yesterday modified rates; compared against 
created_on_utc (a UTC timestamp), so bind
+        // the tenant's actual start-of-day boundary rather than a bare date, 
which the DB would otherwise interpret
+        // in its own session time zone instead of the tenant's.
+        OffsetDateTime yesterday = 
DateUtils.getOffsetDateTimeOfTenantFromLocalDate(DateUtils.getBusinessLocalDate().minusDays(1));

Review Comment:
   `OffsetDateTime.of(date.atStartOfDay(), 
getOffsetDateTimeOfTenant().getOffset());` might be better here... while it is 
an edge case, but today's offset might be misleading around DST



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