Bug 28968

Summary: recreateIssueStatistics.pl should (optionally?) ignore the anonymous borrower
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: robin
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:
Circulation function:
Bug Depends on:    
Bug Blocks: 28969    

Description Andrew Fuerste-Henry 2021-09-07 21:23:04 UTC
The script recreateIssueStatistics.pl compares issues/old_issues to statistics to determine if there are any borrowernumber/itemnumber/date combinations present in the former that are not present in the latter. If it finds anything in (old_)issues that's not in statistics, it writes it into statistics to correct things.

However, this goes awry really quickly if one is anonymizing reading history. In those cases, we expect to have a bunch of entries in old_issues tied to the anonymous borrower, but we never expect to find the anonymous borrower in the statistics table because we're maintaining the actual patron's borrowernumber there.

recreateIssueStatistics.pl should have the option to *not* copy/recreate issues tied to the anonymous borrower.
Comment 1 Katrin Fischer 2023-07-01 13:40:02 UTC
But won't this lead to missing checkouts/checking if you use statistics table for statistics? It might be better as a switch/option on the script.