Bug 12082

Summary: hold statistics wizard can produce misleading results
Product: Koha Reporter: Galen Charlton <gmcharlt>
Component: ReportsAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13914
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Galen Charlton 2014-04-15 00:28:19 UTC
The hold statistics wizards can produce or misleading incorrect results.  Here are at least two circumstances:

Case 1:

- hold status = active column
- hold date = active row, with date range 3/1/2014-3/2/2014
- holding library: not blank
- home library: not blank

Because the filters get applied even if they're not selected as the row or column, in this case the report doesn't count any bib-level requests that are not yet filled or which were cancelled.  This is because the home/holding library comes into play only if there is an item number set, which doesn't happen for bib-level requests until the hold is captured.

This can result in a hard-to-explain situation where running a report on the number of holds in the previous month can change over time as holds placed towards the end of the month get filled.

Case 2:

- hold status = active column
- hold date = active row, with date range 3/1/2014-3/2/2014
- holding library blank
- home library blank

If there happens to be a case where, for a given date, the number of requests of a given status is the same in both reserves and old_reserves, the fact that a "UNION" is used rather than a "UNION ALL" means that only one set is counted.