Comment 0 for bug 2051599

Revision history for this message
Galen Charlton (gmc) wrote :

Because of the use of Date.toISOString() when munging the cash report start and end date, if you open the cash reports page late enough in your day that it is the following day in UTC (and make no changes to the two date selectors), it will attempt to fetch payments made the following day - which wouldn't exist.

To state this concretely, suppose that you are in the US PST time zone and keep the library open until 9 p.m. on 1/16/2024. When you open the cash reports page to reconcile before leaving, the start and end date that gets passed to open-ils.circ.money.org_unit.desk_payments (e.g.) will be "2024-01-17", not "2024-01-16".

Interacting with the date selectors, even if you change them back to the same value, reset the Javascript Date object to 00:00:00 of the current day _in the browser's timezone_, which generally won't exercise the bug created by attempting to parse the output of Date.toISOString() as if it were in the browser's time zone rather than UTC.

Using DateUtil.localYmdFromDate() rather than parsing the output of Date.toISOString() in searchForData() in Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts would avoid this problem.

This was introduced by a patch for bug 2002343.