galovics commented on code in PR #6724:
URL: https://github.com/apache/fineract/pull/6724#discussion_r4359167814
##########
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:
Good catch — this was already addressed on the latest push: the query now
binds `DateUtils.getOffsetDateTimeOfTenantFromLocalDate(...)`, which is exactly
`OffsetDateTime.of(date.atStartOfDay(),
getOffsetDateTimeOfTenant().getOffset())` internally. Also added an integration
test
(`testScheduledJobRecalculatesEmiOnFloatingRateChangeAddedAfterDisbursement`)
covering this fix end-to-end via the scheduled job, since nothing else
exercised that path - verified it fails on the old `created_date` filter and
passes with the fix.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]