LP1915440 Clear Hopeless Date on Capture
authorBill Erickson <berickxx@gmail.com>
Mon, 8 Aug 2022 18:04:55 +0000 (14:04 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 16 Nov 2022 16:44:37 +0000 (11:44 -0500)
Clear the hold hopeless date when a copy is captured for the hold.

One way to make this happen for testing:

. Configure the Missing copy status as holdable=true hopeless_prone=true
. Place hold with only 1 viable copy.
. Mark said copy as missing -- this stamps a hopeless_date on the hold.
. Check the copy in.  This results in a capture + hopeless hold.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Susan Morrison <smorrison@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index aec6471..8d34d7c 100644 (file)
@@ -1892,6 +1892,7 @@ sub handle_checkout_holds {
     $logger->debug("circulator: checkout fulfilling hold " . $hold->id);
 
     # if the hold was never officially captured, capture it.
+    $hold->clear_hopeless_date;
     $hold->current_copy($copy->id);
     $hold->capture_time('now') unless $hold->capture_time;
     $hold->fulfillment_time('now');
@@ -3354,6 +3355,7 @@ sub attempt_checkin_hold_capture {
 
     $logger->info("circulator: found permitted hold ".$hold->id." for copy, capturing...");
 
+    $hold->clear_hopeless_date;
     $hold->current_copy($copy->id);
     $hold->capture_time('now');
     $self->put_hold_on_shelf($hold)