Partial fix for Bug 4870, Damaged status does not prevent items from being selected...
authorOwen Leonard <oleonard@myacpl.org>
Wed, 6 Apr 2011 07:51:45 +0000 (09:51 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 6 Apr 2011 08:21:07 +0000 (20:21 +1200)
This patch changes the holds queue build process in order to
require that items not be damaged in order to appear in the
holds queue report.

Revision adds a check for the AllowHoldsOnDamagedItems preference to
determine whether a damaged item should be included in the holds
queue report.

Signed-off-by: Christophe Croullebois <christophe.croullebois@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
misc/cronjobs/holds/build_holds_queue.pl

index b02ab60..f01153e 100755 (executable)
@@ -168,8 +168,9 @@ sub GetItemsAvailableToFillHoldRequestsForBib {
     $items_query .=   "WHERE items.notforloan = 0
                        AND holdingbranch IS NOT NULL
                        AND itemlost = 0
-                       AND wthdrawn = 0
-                       AND items.onloan IS NULL
+                       AND wthdrawn = 0";
+    $items_query .=   " AND damaged = 0 " unless C4::Context->preference('AllowHoldsOnDamagedItems');
+    $items_query .=   " AND items.onloan IS NULL
                        AND (itemtypes.notforloan IS NULL OR itemtypes.notforloan = 0)
                        AND itemnumber NOT IN (
                            SELECT itemnumber