Bug 8419 - Suspended holds appear on the daily holds queue
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 11 Jul 2012 14:16:35 +0000 (10:16 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 31 Aug 2012 15:56:46 +0000 (17:56 +0200)
Suspended holds are showing up in both the holds queue and holds to pull reports.

This patch adds to the sql queries such that any hold that is suspended
is not selected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
circ/pendingreserves.pl
misc/cronjobs/holds/build_holds_queue.pl

index 52a0450..61bace9 100755 (executable)
@@ -142,6 +142,7 @@ if ( $run_report ) {
     AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
     AND issues.itemnumber IS NULL
     AND reserves.priority <> 0 
+    AND reserves.suspend = 0
     AND notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0
     ";
     # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when 
index f01153e..d920c04 100755 (executable)
@@ -82,7 +82,9 @@ sub GetBibsWithPendingHoldRequests {
                      FROM reserves
                      WHERE found IS NULL
                      AND priority > 0
-                     AND reservedate <= CURRENT_DATE()";
+                     AND reservedate <= CURRENT_DATE()
+                     AND suspend = 0
+                     ";
     my $sth = $dbh->prepare($bib_query);
 
     $sth->execute();
@@ -125,6 +127,7 @@ sub GetPendingHoldRequestsForBib {
                          AND found IS NULL
                          AND priority > 0
                          AND reservedate <= CURRENT_DATE()
+                         AND suspend = 0
                          ORDER BY priority";
     my $sth = $dbh->prepare($request_query);
     $sth->execute($biblionumber);