Bug 21320: Holds to pull should honor syspref AllowHoldsOnDamagedItems
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Sep 2018 11:21:53 +0000 (13:21 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 15 Oct 2018 12:52:55 +0000 (12:52 +0000)
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 <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

circ/pendingreserves.pl

index 7f03d88..734b8d7 100755 (executable)
@@ -170,6 +170,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.reserve_id,
@@ -214,7 +219,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