Libraries are reporting that the LocalUse Circulation Statistics offer empty results once setup and then ran. The other selections return results.
To recreate: 1. Set RecordLocalUseOnReturn to 'Record' 2. Record some local uses by checking in items 3. You can double check the DB that local uses are getting record with: select localuse from items where itemnumber = ITEMNUMBER; 4. Go to reports > Statistics wizards -> Circulation 5. Adjust "Type:" to "Local use" 6. Notice there are 0 results
Created attachment 187489 [details] [review] Bug 40961: Fix query for localuse
Very unsure about this patch. It skips looking for items.homebranch or borrowers.branchcode if local use is selected, because those values can be NULL.
This is sort of a weird issue. If one records local use via checkin with the RecordLocalUseOnReturn syspref, those localuse entries will always lack a borrowernumber and therefor have a NULL for patron's home library. That means they won't come up in any query made via the wizard that selects a value for patron's home library. But if one records local use via a statistical patron, then there will be an associated borrowernumber and therefore a patron home library and folks may want to filter their results based on that value. Prior to Bug 20601, the patron library dropdown in the wizard didn't work and therefore didn't impact these queries.
Expanding on that comment: the current behavior is technically correct but confusing to the user.
I don't think Lucas's original fix here is the way to go. He told the query to ignore both the associated borrower's branch and the associated item's homebranch. If a library is using statistical patrons, the borrower's branch will have a value that libraries may want to use for differentiating local use counts. The item's homebranch should always have an item, even if the item has been deleted. In the circulation statistics wizard the various library values correspond to: Issuing library - the value record in statistics.branch when the transaction took place Home library - the current home library of the item in question Holding library - the current holding library of the item in question Patron library - the current library of the associated patron used (if any - for local use there is only a patron if statistical patrons are used) So if the user lands on the circulation statistics page, changes Type to "Local use" and runs the query with the default values they get all local uses that happened at the logged-in branch, involving items with home and holding values matching the logged-in branch, and to patrons from the logged-in branch. That's a very specific query and seems unlikely to match what folks want. I suggest we make the page load with home library, holding library, and patron library all set to blank. That would make the default search simply all transactions of the given type that happened at the logged-in branch. Broad but clear.
Created attachment 189715 [details] [review] Bug 40961: Default item and patron library values to blank To test: 1 - load the Circulation Statistics wizard 2 - confirm Home library, Holding library, and Patron library default to selecting the logged-in branch 3 - apply patch, restart_all, reload page 4 - confirm Home library, Holding library, and Patron library default to a blank selection 5 - confirm queries with those blank selections are not limited by items.homebranch, items.holdingbranch, or borrowers.branchcode
Created attachment 189869 [details] [review] Bug 40961: Default item and patron library values to blank To test: 1 - load the Circulation Statistics wizard 2 - confirm Home library, Holding library, and Patron library default to selecting the logged-in branch 3 - apply patch, restart_all, reload page 4 - confirm Home library, Holding library, and Patron library default to a blank selection 5 - confirm queries with those blank selections are not limited by items.homebranch, items.holdingbranch, or borrowers.branchcode Signed-off-by: Katherine Wolf <wolf@sarsf.org>