Bug 11530

Summary: Recalculating a book's total issue count from items.issues or statistics-table with update_totalissues.pl ignores deleted_items.
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: Command-line UtilitiesAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Olli-Antti Kivilahti 2014-01-13 15:14:07 UTC
--------------------------
- REPLICATING THIS ISSUE -
--------------------------

If we had a biblio, with 4 items, each being issued 50 times.
Running the update_totalissues.pl in stats or items -mode would yield a biblioitems.totalissues value of 200.

If we get rid of one of the books, and recalculate, the biblioitems.totalissues value will drop to 150!

update_totalissues.pl works in incremental mode, but a recalculation will ignore deleted items.
Comment 1 Fridolin Somers 2020-01-28 08:50:37 UTC
Since statistics contains only itemnumber, once item deleted we can not link this itemnumber to its biblionumber.
Comment 2 Katrin Fischer 2020-01-28 20:22:09 UTC
(In reply to Fridolin SOMERS from comment #1)
> Since statistics contains only itemnumber, once item deleted we can not link
> this itemnumber to its biblionumber.

What we do is use a union of items and deleteditems in most reports - then you can.