A client noticed that deleted items are not counted in circulation stats when using the statistics wizard. Here is the test plan: 1) Search the catalog for a record with an available item 2) Loan out that item to a user and return it 3) Go in Reports > Statistics wizards > Circulation 4) Fill in the form - Choose a period that includes today - Choose "Type" = Checkout - Choose Item type for both "Row" and "Column" 5) Leave the rest as is and click "Submit" 6) Note the quantity of loans for the itemtype of your item 7) Go back to your item and delete it 8) Go back to your report and refresh 9) Notice that the amount of loans is less than it was before It's not because the item is deleted that the loan didn't happen The wizard should look at both items and deleted_items to calculate the amount of circulation transactions.
It would be great for troubleshooting if the SQL query created by the wizard was available through a button on the page (like regular SQL reports).
+1 on this, having just run into the same question. By default, the circ wizard is limiting based on homebranch and holdingbranch, but only based on the items table, where items.homebranch and items.holdingbranch are null for things that only exist in deleteditems. If you set those dropdowns to blank and don't limit based on anything else that exists in items rather than statistics, then the wizard will include stats for deleted items. I'd be ok with an immediate quick-fix of just not making this default to limiting based on homebranch and holdingbranch. I'd be even happier about making the wizard look at both items and deleteditems. If we could also get some way to see the SQL used by the wizard, for diagnostic purposes, that'd be amazing.
Created attachment 128011 [details] [review] Bug 21982: Statistic assistant - Circulation By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown
Created attachment 128012 [details] [review] BZ 34887: Statistic assistant - Circulation By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown
Created attachment 128013 [details] [review] Bug 21982: Circulation statistics wizard does not count deleted items By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown
Created attachment 128026 [details] [review] Bug 21982: Circulation statistics wizard does not count deleted items By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown
Works as described, signing off. Thanks for the patch!
Created attachment 138075 [details] [review] Bug 21982: Circulation statistics wizard does not count deleted items By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Created attachment 138106 [details] [review] Bug 21982: Circulation statistics wizard does not count deleted items By default statistic assistant filter is set on the existing items and doesn't mind about deleted items. The patch corrects this. Items belong to the same library. Test plan: 1)Make sure to have at least 1 or more item(s) in deleteditems database table 2)Home > Reports > Circulation statistics 3)Fill up 'Issuing library', 'Home library' and 'Holding library' 4)Submit 5)Notice that only statistics for active items are shown 6)Apply patch and repeat from 2) to 5) 7)Now active items and deleted items are shown Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for 22.05.05
Thanks! Pushed to 21.11 for 21.11.12
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.