Fix inability to suspend holds
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 31 Jan 2012 15:48:25 +0000 (10:48 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 27 Feb 2012 22:36:16 +0000 (17:36 -0500)
The hold status code was being used for "has the hold been captured", but
the value for "frozen" was after the cutoff being assumed for "captured".

So check for the suspended code specifically in the if, and don't return
the suspended code if there is a capture time.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

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

index 9271c5d..5c840c5 100644 (file)
@@ -935,7 +935,7 @@ sub update_hold_impl {
     # --------------------------------------------------------------
     if ($U->is_true($hold->frozen) and not $U->is_true($orig_hold->frozen)) {
         $hold_status = _hold_status($e, $hold);
-        if ($hold_status > 2) { # hold is captured
+        if ($hold_status > 2 && $hold_status != 7) { # hold is captured
             $logger->info("bypassing hold freeze on captured hold");
             return OpenILS::Event->new('HOLD_SUSPEND_AFTER_CAPTURE');
         }
@@ -1177,7 +1177,7 @@ sub _hold_status {
     if ($hold->cancel_time) {
         return 6;
     }
-    if ($U->is_true($hold->frozen)) {
+    if ($U->is_true($hold->frozen) && !$hold->capture_time) {
         return 7;
     }
     if ($hold->current_shelf_lib and $hold->current_shelf_lib ne $hold->pickup_lib) {