| Summary: | LocalUse Circulation Statistics offering empty results | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Todd Goatley <tgoatley> |
| Component: | Reports | Assignee: | Andrew Fuerste-Henry <andrew> |
| Status: | Pushed to oldstable --- | QA Contact: | Marcel de Rooy <m.de.rooy> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | andrew, carthur, fridolin.somers, lisette, lucas, m.de.rooy |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: |
25.11.00,25.05.06,24.11.11
|
|
| Circulation function: | |||
| Attachments: |
Bug 40961: Fix query for localuse
Bug 40961: Default item and patron library values to blank Bug 40961: Default item and patron library values to blank Bug 40961: Default item and patron library values to blank |
||
|
Description
Todd Goatley
2025-10-06 17:20:17 UTC
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> Since this script is not only about LocalUse, I actually do not understand why we are clearing all those fields for anyone here. In Discussion (In reply to Marcel de Rooy from comment #9) > Since this script is not only about LocalUse, I actually do not understand > why we are clearing all those fields for anyone here. > > In Discussion Looking at the other statistics wizards, we are inconsistent about when we set a default library for queries and when we do not. These changes make the Circulation wizard consistent with the Holds wizard, where we set a default value for Pickup library but not for item home or holding branch. To me, it seems most clear to the user to default to a broad query and allow the user to make it more specific as desired. This rationale applies to queries for checkouts, renewals, and checkins as well as local use. This bug was originally filed because users from several libraries found the current default query confusing and undesirable. Created attachment 190045 [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> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> (In reply to Andrew Fuerste-Henry from comment #10) > (In reply to Marcel de Rooy from comment #9) > > Since this script is not only about LocalUse, I actually do not understand > > why we are clearing all those fields for anyone here. > > > > In Discussion > > Looking at the other statistics wizards, we are inconsistent about when we > set a default library for queries and when we do not. These changes make the > Circulation wizard consistent with the Holds wizard, where we set a default > value for Pickup library but not for item home or holding branch. > > To me, it seems most clear to the user to default to a broad query and allow > the user to make it more specific as desired. This rationale applies to > queries for checkouts, renewals, and checkins as well as local use. This bug > was originally filed because users from several libraries found the current > default query confusing and undesirable. Sounds fair to me given inconsistencies. Passing QA. See what happens :) Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x Pushed to 24.11.x for 24.11.11 |