From bb38fa044728a290f46f3129caf7dc4b72129bbc Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 6 Sep 2018 13:21:53 +0200 Subject: [PATCH] Bug 21320: Holds to pull should honor syspref AllowHoldsOnDamagedItems Test plan: 1. Set syspref AllowHoldsOnDamagedItems to Allow 2. Create a hold on record with item which is damaged 3. Verify that it doesn't appear in report 4. Apply patch and verify that it's now visible Signed-off-by: Caroline Cyr La Rose Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens (cherry picked from commit b23fe0b0b8d468fe80d40aef1a12296421cc1d37) Signed-off-by: Martin Renvoize (cherry picked from commit 42e8d66369c6b38caeab85ddd5a1021623ca4628) Signed-off-by: Fridolin Somers --- circ/pendingreserves.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 6c9a0cfce8..1e4ac7b0f4 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -91,6 +91,11 @@ if ($enddate_iso) { my $item_type = C4::Context->preference('item-level_itypes') ? "items.itype" : "biblioitems.itemtype"; +# Bug 21320 +if ( ! C4::Context->preference('AllowHoldsOnDamagedItems') ) { + $sqldatewhere .= " AND damaged = 0"; +} + my $strsth = "SELECT min(reservedate) as l_reservedate, reserves.borrowernumber as borrowernumber, @@ -130,7 +135,7 @@ my $strsth = AND issues.itemnumber IS NULL AND reserves.priority <> 0 AND reserves.suspend = 0 - AND notforloan = 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0 + AND notforloan = 0 AND itemlost = 0 AND withdrawn = 0 "; # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when # multiple patrons have a hold on an item -- 2.39.5