[Bug 39015] New: Date sorting not working in statistics wizards
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Bug ID: 39015 Summary: Date sorting not working in statistics wizards Change sponsored?: --- Product: Koha Version: 23.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: david.roberts@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org If a site has the dateformat system preference set to dd/mm/yyyy, date sorting doesn't work in the statistics wizards - e.g. /cgi-bin/koha/reports/cash_register_stats.pl. It does seem to sort correctly if the dateformat is set to mm/dd/yyyy. This might be connected to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37875 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |oleonard@myacpl.org |ity.org | Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|23.11 |Main Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 177469 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177469&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |38984 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38984 [Bug 38984] DataTables's columnDefs cleanup -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177469|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 177470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177470&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177470|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 177662 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177662&action=edit 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 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes date sorting for release notes| |the cash register | |statistics wizard so that | |columns with dates sort | |correctly (it adds a | |"data-sort" attribute to | |the columns in the results | |table which contain dates - | |this allows DataTables to | |sort using the unformatted | |date). It also adds the | |"anti-the" class to the | |title column, so that it | |sorts excluding articles | |such as a, the, and an. --- Comment #4 from David Nind <david@davidnind.com> --- Testing notes using KTD: 1. I could replicate the date sorting issue with dates in the dd/mm/yyyy format, other date formats worked as expected. 2. Example query to update the date field: - koha-mysql kohadev - update accountlines set date="2025-01-15 12:00:00" where accountlines_id=3; - amend to reflect the data in your databases - list all transactions: select * from accountlines; - I amended the dates so that they were in different months and years 3. I amended the record titles to include the, a, and an at the start of the title - they now correctly sort by ignoring the article. 4. For the "Transaction type" field selector, I changed to "All transactions". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #177662|0 |1 is obsolete| | --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 178770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178770&action=edit 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 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com QA Contact|testopia@bugs.koha-communit |baptiste.wojtkowski@biblibr |y.org |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #6 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Works perfectly even not on top of 38984, may I remove the dependency for QA ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Baptiste Wojtkowski (bwoj) from comment #6)
Works perfectly even not on top of 38984, may I remove the dependency for QA ?
Please don't remove the dependency in Bugzilla. You can QA, but we'll need to set the status to BLOCKED if it passes, until 38984 has been processed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |BLOCKED --- Comment #8 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Ok, then I'm fine with this one + QA tool passes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please still add your sign-off lines :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178770|0 |1 is obsolete| | --- Comment #10 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Created attachment 178780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178780&action=edit 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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Why block a bug when it doesn't need to be blocked.. especially when what you're blocking it on is an enhancement which won't be backported. I don't understand the logic here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I would have set it to BLOCKED too - this is actually PQA, but the dependency on bug 38984 needs to move to PQA before we can push it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #12)
I would have set it to BLOCKED too - this is actually PQA, but the dependency on bug 38984 needs to move to PQA before we can push it.
I just checked - Owen is patch author here and Owen set the dependency, so I believe it to be correct. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Sorry, if I am misunderstanding the comment - might be missing something here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #15 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Katrin Fischer from comment #13)
I would have set it to BLOCKED too - this is actually PQA, but the dependency on bug 38984 needs to move to PQA before we can push it.
I go by what the RM says! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Passed QA CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Oddly enough this applies without the depedency... ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Date sorting not working in |Date sorting not working in |statistics wizards |cash register statistics | |wizard -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Needs documenting --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 38984 not in 24.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39015 --- Comment #19 from David Nind <david@davidnind.com> --- Bug fix, no changes required to the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org