Bug 31594

Summary: Report results count of shown can be incorrect on last page
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ReportsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: minor    
Priority: P5 - low CC: arthur.suzuki, lucas
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:
22.11.00, 22.05.08, 21.11.15
Attachments: Bug 31594: Use ount of results for displaying number shown
Bug 31594: Use ount of results for displaying number shown
Bug 31594: Use ount of results for displaying number shown
Bug 31594: Use count of results for displaying number shown

Description Nick Clemens (kidclamp) 2022-09-21 14:14:26 UTC
When a report has more than 20 results, but not a multiple of twenty the final page can have 5 results say, but koha still says:
25 results (20 shown)

We should count the number of results for display of shown
Comment 1 Nick Clemens (kidclamp) 2022-09-21 14:18:41 UTC
Created attachment 140821 [details] [review]
Bug 31594: Use ount of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)
Comment 2 Owen Leonard 2022-09-21 18:38:12 UTC
Created attachment 140827 [details] [review]
Bug 31594: Use ount of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2022-10-02 09:22:35 UTC
Created attachment 141203 [details] [review]
Bug 31594: Use ount of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2022-10-02 09:22:50 UTC
Small logical fix, nice enhancement - love :)
Comment 5 Tomás Cohen Arazi 2022-10-03 13:07:17 UTC
Created attachment 141262 [details] [review]
Bug 31594: Use count of results for displaying number shown

To test:
1 - Create a report with a number of results that is not a multiple of 20
    SELECT barcode FROM items
2 - Run the report
3 - Go to the final page
4 - Note report says 20 shown, but there are less
5 - Apply patch
6 - Reload and confirm correct number of shown is shown :-)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2022-10-03 13:10:14 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 7 Lucas Gass 2022-12-05 15:54:49 UTC
Backported to 22.05.x for upcoming 22.05.08 release
Comment 8 Arthur Suzuki 2022-12-14 09:45:41 UTC
applied to 21.11 for 21.11.15