Summary: | Date sorting not working in statistics wizards | ||
---|---|---|---|
Product: | Koha | Reporter: | David Roberts <david.roberts> |
Component: | Reports | Assignee: | Owen Leonard <oleonard> |
Status: | Needs Signoff --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | ||
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 38984 | ||
Bug Blocks: | |||
Attachments: |
Bug 39015: Fix sorting by date on cash register statistics page
Bug 39015: Fix sorting by date on cash register statistics page |
Description
David Roberts
2025-02-03 11:28:16 UTC
Created attachment 177469 [details] [review] Bug 39015: Fix sorting by date on cash register statistics page This patch adds a "data-sort" attribute to the columns in the results table which contain dates. This allows DataTables to sort using the unformatted date. The patch also adds the "anti-the" class to the column containing titles, ensuring that the sort excludes articles. To test, apply the patch and go to Reports -> Statistics wizards -> Cash register. You must have multiple entries in the results, which could be generated by using the "Create manual invoice" form under a patron's account tab. Unfortunately that won't create entries with multiple dates to sort on. I assume a proper test will require some manual SQL updates. To test title sorting you should have some transactions which are tied to an item. To generate this data: - Set the 'WhenLostChargeReplacementFee' system preference to "Charge" - Add a replacement cost to some items in the catalog. - Check those items out ot a patron. - From the "Item details" tab for those records, mark each item lost. - The charges should now be on the patron's account. - On the Cash register statistics page, submit the form using parameters which will return multiple results. - Test that the "Transaction date" and "Updated" columns work correctly with various settings of the "dateformat" system preference. - Test that the "Bibliographic record title" column sorts correctly, excluding initial articles (a, an, the) from the sort. Sponsored-by: Athens County Public Libraries Created attachment 177470 [details] [review] Bug 39015: Fix sorting by date on cash register statistics page This patch adds a "data-sort" attribute to the columns in the results table which contain dates. This allows DataTables to sort using the unformatted date. The patch also adds the "anti-the" class to the column containing titles, ensuring that the sort excludes articles. To test, apply the patch and go to Reports -> Statistics wizards -> Cash register. You must have multiple entries in the results, which could be generated by using the "Create manual invoice" form under a patron's account tab. Unfortunately that won't create entries with multiple dates to sort on. I assume a proper test will require some manual SQL updates. To test title sorting you should have some transactions which are tied to an item. To generate this data: - Set the 'WhenLostChargeReplacementFee' system preference to "Charge" - Add a replacement cost to some items in the catalog. - Check those items out ot a patron. - From the "Item details" tab for those records, mark each item lost. - The charges should now be on the patron's account. - On the Cash register statistics page, submit the form using parameters which will return multiple results. - Test that the "Transaction date" and "Updated" columns work correctly with various settings of the "dateformat" system preference. - Test that the "Bibliographic record title" column sorts correctly, excluding initial articles (a, an, the) from the sort. Sponsored-by: Athens County Public Libraries |