From 2362b3c6c0fd88a317b23ca7cabb7364faab6aff Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 6 Apr 2011 09:51:45 +0200 Subject: [PATCH] Partial fix for Bug 4870, Damaged status does not prevent items from being selected for reserves 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 Signed-off-by: Chris Cormack (cherry picked from commit 0f7411ceee5887751fb34ad2c72c83216d55f0c1) Signed-off-by: Chris Nighswonger --- misc/cronjobs/holds/build_holds_queue.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index b02ab604ad..f01153e395 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/misc/cronjobs/holds/build_holds_queue.pl @@ -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 -- 2.39.5