Summary: | Recalculating an item's total issue count with update_totalissues.pl ignores deleted items | ||
---|---|---|---|
Product: | Koha | Reporter: | Olli-Antti Kivilahti <olli-antti.kivilahti> |
Component: | Command-line Utilities | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | david, fridolin.somers, lisette, lucas |
Version: | Main | Keywords: | no-sandbox |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This enhancement to the misc/cronjobs/update_totalissues.pl script[1] adds a new --use-deleted-items option. With this option, a records' usage count will now include deleted items.
[1] This script updates the total issues usage count for a record. For MARC21, this is recorded in 942$o - Koha issues (borrowed), all copies.
|
Version(s) released in: | |
Circulation function: | |||
Attachments: |
Bug 11530: Add a use-deleted-items option to totalissues.pl
Bug 11530: Fix warning of undefined value Bug 11530: Add a use-deleted-items option to totalissues.pl Bug 11530: Fix warning of undefined value |
Description
Olli-Antti Kivilahti
2014-01-13 15:14:07 UTC
Since statistics contains only itemnumber, once item deleted we can not link this itemnumber to its biblionumber. (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. Created attachment 175880 [details] [review] Bug 11530: Add a use-deleted-items option to totalissues.pl Some libraries would like to keep the usage from deleted items when calculating total issues from the items. To test: 0 - Apply patch 1 - Checkout/Check in an item several times 2 - perl misc/cronjobs/update_totalissues.pl --use-items 3 - Note the 942$o in the record has the correct count 4 - Delete the item 5 - perl misc/cronjobs/update_totalissues.pl --use-items 6 - Note record count now goes to 0 8 - perl misc/cronjobs/update_totalissues.pl --use-items --use-deleted-items 9 - Note record count correctly restored Created attachment 175881 [details] [review] Bug 11530: Fix warning of undefined value We always check the return of UpdateTotalIssues, we shouldn't let it return null This is a nice fix that I know many libraries will appreciate. Created attachment 176300 [details] [review] Bug 11530: Add a use-deleted-items option to totalissues.pl Some libraries would like to keep the usage from deleted items when calculating total issues from the items. To test: 0 - Apply patch 1 - Checkout/Check in an item several times 2 - perl misc/cronjobs/update_totalissues.pl --use-items 3 - Note the 942$o in the record has the correct count 4 - Delete the item 5 - perl misc/cronjobs/update_totalissues.pl --use-items 6 - Note record count now goes to 0 8 - perl misc/cronjobs/update_totalissues.pl --use-items --use-deleted-items 9 - Note record count correctly restored Signed-off-by: David Nind <david@davidnind.com> Created attachment 176301 [details] [review] Bug 11530: Fix warning of undefined value We always check the return of UpdateTotalIssues, we shouldn't let it return null Signed-off-by: David Nind <david@davidnind.com> |