Bug 31557 - Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library
Summary: Add ability for holds queue builder to prioritize either matching a patron's ...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 21.11
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 32089
  Show dependency treegraph
 
Reported: 2022-09-13 20:22 UTC by Sara Brown
Modified: 2022-11-03 15:28 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library (9.37 KB, patch)
2022-10-18 16:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library (9.43 KB, patch)
2022-11-03 15:28 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sara Brown 2022-09-13 20:22:54 UTC
It would be helpful if build_holds_queue.pl either 1) checked items' holding libraries in addition to home when items float, or 2) used the Transport Cost Matrix instead when systems have it enabled. Using home library only/first results in higher 'costs' and in holds being filled more slowly than necessary, and can be confusing for libraries.

Home/holding:
If I understand correctly, build_holds_queue.pl looks for items whose home library matches the hold's pickup library (plus accounting for any preferences set in StaticHoldsQueueWeight/HoldsQueueSkipClosed/RandomizeHoldsQueueWeight). 
For example, in a system where items float, a hold to be picked up at West library has the following items:
Item 1: Home library West, holding library East
Item 2: Home library West, holding library West
Item 3: Home library North, holding library West

If build_holds_queue.pl sees Item 1 first, it will be placed on East's queue to send to West even though Item 2 is already at West and could fill the hold more efficiently.

Then since the Transport Cost Matrix is only consulted if no available items have a home library matching the hold's pickup library, holds are filled in a more 'expensive' way than libraries may expect. Using the Transport Cost Matrix directly would address this.

For example, in a system where items float and a hold is to be picked up at South:
Item 1: Home library East, holding library South
Item 2: Home library West, holding library West
Item 3: Home library South, holding library West

build_holds_queue.pl will see that Item 3 has a home library matching the pickup library and will place it on West's queue to send to South. If build_holds_queue.pl consulted the Transport Cost Matrix, Item 1 would be placed on South's queue with no transfer necessary.
Comment 1 Kyle M Hall 2022-10-18 16:49:55 UTC
Created attachment 142082 [details] [review]
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library

Right now the holds queue builder starts filling bib-level holds with
items whose patron's home library matches the item's home library.

It would be good and reasonable to have the option to prioritize
item's whose patron's home library matches the item's holding library
to minimize transfers.
Comment 2 David Nind 2022-11-01 01:37:46 UTC
I updated the assignee...
Comment 3 Andrew Fuerste-Henry 2022-11-03 14:39:28 UTC
Kyle, please let me know if this proposed test plan misses something:

To test:
1: have 2 branches: A, B
2: have a bib with two items: Item 1 with homebranch=A, holdingbranch=B; item 2 with homebranch=B, holdingbranch=A
3: have a patron with homebranch=A
4: place a bib-level hold on your bib for your patron, for pickup at A
5: run build_holds_queue.pl
6: consult the queue, confirm it's targeted Item 1, which will require a transfer to fill
7: apply patch, restart services
8: confirm the new HoldsQueuePrioritizeBranch syspref is set to homebranch
9: run build_holds_queue again
10: confirm nothing changed, still targeting Item 1
11: switch HoldsQueuePrioritizeBranch to holdingbranch
12: run build_holds_queue
13: confirm the queue is now targeting Item 2, which will not require a transfer

I didn't involve the real time holds queue, just for simplicity.
Comment 4 Andrew Fuerste-Henry 2022-11-03 15:28:57 UTC
Created attachment 143136 [details] [review]
Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library

Right now the holds queue builder starts filling bib-level holds with
items whose patron's home library matches the item's home library.

It would be good and reasonable to have the option to prioritize
item's whose patron's home library matches the item's holding library
to minimize transfers.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>