]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#2051599: fix parsing of start and end dates by Cash Reports
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 30 Jan 2024 15:19:22 +0000 (10:19 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 11 Mar 2024 17:32:19 +0000 (13:32 -0400)
commit3c6856f19e7e7b8c7b76e63b642ff26b53befde2
treeda4cddc423a6883b73cab6e5b23404c4c0c7c836
parent95a995fec4a06c8e951625fcd0722037b3f367f4
LP#2051599: fix parsing of start and end dates by Cash Reports

This patch fixes a bug where if you open the Cash Reports at a
time of day where the date in the local time zone is different
from the date in UTC and do not interact with the date selectors,
the report will not display payments made during the current day.

The problem was due to the use of Date.toISOString() when
attempting to extract just the date component; since Date.toISOString()
forces the timestamp to UTC. The effect is that if you (say) open
the Cash Reports page in North America sufficiently late in the date,
the date selectors will display your current date, but the query
to fetch payment information will (silently) supply the following day.

To test
-------
[1] Make some patron bill payments.
[2] Open the Cash Reports at a time of day when an UTC clock would
    report a different date from your local date. Observe that no
    payments are listed or that payments from the previous day are
    listed.
[3] Apply the patch and repeat step 2. This time, opening the Cash
    Reports page should show the payments for the current day.

Release-note: Fix bug that could cause the Cash Reports page to display payments for the wrong day.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts