Bug 38225 - Catalog statistics report shows incorrect total when library has both blank and null values in an item column
Summary: Catalog statistics report shows incorrect total when library has both blank a...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-22 12:17 UTC by Nick Clemens (kidclamp)
Modified: 2024-10-22 12:17 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-10-22 12:17:33 UTC
To recreate:
1 - Browse to Reports->Catalog
2 - Set columns = homelibrary = Centerville
3 - Set row = Collection
4 - Set Cell Value to Count total items
5 - Set Output to To the screen
6 - Run, note columsn match
7 - Change some values in the DB:
    UPDATE items SET ccode="" WHERE ccode='REF' and barcode LIKE '%35';
8 - Run report again, off by one
9 - Edit the code in the script and set:
    our $debug=1
10 - Copy the code from the logs and add the library, or run the command below where I did that already:
    SELECT items.ccode, items.homebranch,  COUNT(*)          FROM items         LEFT JOIN biblioitems ON (items.biblioitemnumber = biblioitems.biblioitemnumber)         LEFT JOIN biblio ON (biblioitems.biblionumber = biblio.biblionumber)         WHERE 1  AND items.homebranch LIKE 'CPL'  group by items.ccode, items.homebranch order by items.ccode,items.homebranch;
11 - Note the row with no value and total 5 - it is missing on the report in the interface, instead NULL has been shown twice - the value overwritten and causing a mismatch in totals