Bug 21027 - Totals in statistics tab change when StatisticsFields is changed
Summary: Totals in statistics tab change when StatisticsFields is changed
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 9939
  Show dependency treegraph
 
Reported: 2018-07-02 14:56 UTC by Katrin Fischer
Modified: 2019-07-15 11:43 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00


Attachments
statistics tab (16.85 KB, image/png)
2018-07-12 05:44 UTC, Katrin Fischer
Details
current checkouts (87.65 KB, image/png)
2018-07-12 05:45 UTC, Katrin Fischer
Details
Bug 21027; Fix checkout statistics if 1+ of the fields is not defined (1017 bytes, patch)
2019-04-29 00:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Screenshot_total_checkouts without patch (96.94 KB, image/jpeg)
2019-04-29 09:42 UTC, Christian Stelzenmüller
Details
Bug 21027; Fix checkout statistics if 1+ of the fields is not defined (1.52 KB, patch)
2019-07-11 06:22 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 21027: Fix checkout statistics if 1+ of the fields is not defined (1.57 KB, patch)
2019-07-12 06:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-07-02 14:56:00 UTC
As we understand it the totals in the last line of the statistics table in the patron account should be always the same, independent of the selection made in the StatisticsFields system preference.

This is not the case.

When "location" is removed, the total is less than with "location".

I think this might have something to do with the group and empty values for some entries, but have not been able to find the problem yet.
Comment 1 Jonathan Druart 2018-07-11 22:09:40 UTC
Screenshots? Which values are different?
Comment 2 Katrin Fischer 2018-07-12 05:32:53 UTC
- Use a patron who hasn't checked out items before
- Set  StatisticsFields to itype|ccode
- Check out some items without location
- Verify that statistics stable shows the correct number of checkouts
- Check out one item with a location or just change one of your checked out items
- Verify the total is still correct
- Change  StatisticsFields to location|itype|ccode
- Verify the total has changed now - it's only 1 (the one with a location)
Comment 3 Katrin Fischer 2018-07-12 05:33:45 UTC
I retested it on master... not quite the same result as last time, but still something strange going on here. Hope the test plan works for you.
Comment 4 Katrin Fischer 2018-07-12 05:44:44 UTC
Created attachment 76874 [details]
statistics tab
Comment 5 Katrin Fischer 2018-07-12 05:45:25 UTC
Created attachment 76875 [details]
current checkouts
Comment 6 Katrin Fischer 2018-07-12 05:46:44 UTC
For the screenshot the pref was set to location|itype|ccode. If location is removed, the number of checkouts shows as 2 (which is correct).

Note: in the screenshot, the shelving location is also not shown?
Comment 7 Jonathan Druart 2019-04-29 00:57:51 UTC
Created attachment 88990 [details] [review]
Bug 21027; Fix checkout statistics if 1+ of the fields is not defined
Comment 8 Jonathan Druart 2019-04-29 00:58:59 UTC
Hi Katrin,

I think this patch fixes the problem you faced. I did not read a test plan as I have to admit I completely forgot about that code and not sure how the changes could be completely tested.
Comment 9 Christian Stelzenmüller 2019-04-29 09:42:39 UTC
Created attachment 89008 [details]
Screenshot_total_checkouts without patch
Comment 10 Chris Cormack 2019-07-11 06:22:11 UTC
Created attachment 91455 [details] [review]
Bug 21027; Fix checkout statistics if 1+ of the fields is not defined

TEST

- Use a patron who hasn't checked out items before
- Set  StatisticsFields to itype|ccode
- Check out some items without location
- Verify that statistics stable shows the correct number of checkouts
- Check out one item with a location or just change one of your checked out items
- Verify the total is still correct
- Change  StatisticsFields to location|itype|ccode
- Verify the total has changed now - it's only 1 (the one with a location)

Apply the patch and try again

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 11 Katrin Fischer 2019-07-12 06:09:00 UTC
Created attachment 91472 [details] [review]
Bug 21027: Fix checkout statistics if 1+ of the fields is not defined

TEST

- Use a patron who hasn't checked out items before
- Set  StatisticsFields to itype|ccode
- Check out some items without location
- Verify that statistics stable shows the correct number of checkouts
- Check out one item with a location or just change one of your checked out items
- Verify the total is still correct
- Change  StatisticsFields to location|itype|ccode
- Verify the total has changed now - it's only 1 (the one with a location)

Apply the patch and try again

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Martin Renvoize 2019-07-15 11:43:38 UTC
Nice work!

Pushed to master for 19.11.00