Ignore canceled holds during alt-queue generation
authorBill Erickson <berick@esilibrary.com>
Wed, 3 Apr 2013 20:21:25 +0000 (16:21 -0400)
committerJason Etheridge <jason@esilibrary.com>
Wed, 3 Apr 2013 21:20:34 +0000 (17:20 -0400)
When zero potential copies exist for a hold, the hold queue stats code
determines the size and shape of the queue by finding and sorting holds
that have the same type and target.  This patch forces the code to
ignore canceled holds when looking for similarly-shaped holds.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 8e7e5f7..9ba8272 100644 (file)
@@ -1378,7 +1378,13 @@ sub retrieve_hold_queue_status_impl {
             ],
             where    => {
                 hold_type => $hold->hold_type,
-                target    => $hold->target
+                target    => $hold->target,
+                capture_time => undef,
+                cancel_time => undef,
+                '-or' => [
+                    {expire_time => undef },
+                    {expire_time => {'>' => 'now'}}
+                ]
            }
         });
     }