From fc1d5fa273fea03865412d75e2d57aeb3e0fd4c3 Mon Sep 17 00:00:00 2001 From: Josh Stompro Date: Tue, 10 Mar 2020 11:38:48 -0500 Subject: [PATCH] LP1866667 - Clear current_copy when pickup_lib is changed and waiting for capture When a user changes the pickup lib and a retarget is triggered the currently targeted copy gets excluded if there are other available copies. This can cause delays and confusion since the new copy may not be the best choice. This change clears the current_copy before the retarget in that situation. Testing setup. Find/create a title with items that looks like: System X -> Branch A -> Holdable item Branch B -> System Y Branch C -> Holdable item Branch D -> Holdable item Place a hold with a pickup location of Branch B, which should target the closest item at Branch A Then change the pickup location of your hold to Branch A. The retarget that happens, should switch the targeted copy to Branch C or D. After Change Applied: The hold should remain targeted to Branch A after pickup lib is changed to Branch A. Signed-off-by: Josh Stompro Signed-off-by: Dawn Dale Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 1a8667a608..12eada6051 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1317,6 +1317,12 @@ sub update_hold_impl { # clear to prevent premature shelf expiration $hold->clear_shelf_expire_time; } + # If a copy is targeted and pickup lib changes, + # clear the current_copy so a retarget will re-evaluate + # the hold from scratch. + } elsif ($hold_status == 2) { + $logger->info("Pickup location changed and waiting for capture, clear current_copy for hold ".$hold->id); + $hold->clear_current_copy; } } -- 2.11.0