Cash Reports can try to report on payments made in the future

Bug #2051599 reported by Galen Charlton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.11
Fix Released
High
Unassigned

Bug Description

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.

Evergreen 3.11 and later

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → High
tags: added: admin-pages circ-billing regression
description: updated
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :
tags: added: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Galen! Bug and fix confirmed. Signoff branch at https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp2051599_fix_cash_reports_time_travel / user/sandbergja/lp2051599_fix_cash_reports_time_travel

Changed in evergreen:
status: New → Confirmed
tags: added: signedoff
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
milestone: none → 3.12.3
Revision history for this message
Bill Erickson (berick) wrote :

New branch posted with my sign-off plus a commit to apply the same change to the userPaymentDataSource a few lines down in the source.

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp2051599-cash-reports-time-travel-v2

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Galen Charlton (gmc) wrote :

I've cross-signed off and pushed to main, rel_3_12, and rel_3_11. Thanks, Jane and Bill!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.