Bug 13640: Do not display unreserveable items on the Holds to pull screen
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 13 May 2019 14:57:52 +0000 (09:57 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 21 Jun 2019 09:00:46 +0000 (10:00 +0100)
We should only display the items that meet the hold policies

Test plan:
It would be good to have a huge list of holds displayed on the "Holds to
pull" and confirm that the display is now correct.

One of the possible test plan has been let in a comment on the bug
report:
Bib Record A has 2 items:

Item Record X (can be placed on hold)
Item Record Y (cannot be placed on hold)

If you place a bib-level hold on Bib Record A, both Item Record X and
Item Record Y show up as available items in the Holds To Pull List.

With this patch applied you must not see Y

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

circ/pendingreserves.pl

index d0c7274..56acc2d 100755 (executable)
@@ -210,6 +210,7 @@ my $strsth =
         LEFT JOIN branchtransfers ON items.itemnumber=branchtransfers.itemnumber
         LEFT JOIN issues ON items.itemnumber=issues.itemnumber
         LEFT JOIN borrowers ON reserves.borrowernumber=borrowers.borrowernumber
+        LEFT JOIN default_branch_item_rules ON items.itype=default_branch_item_rules.itemtype
     WHERE
     reserves.found IS NULL
     $sqldatewhere
@@ -220,6 +221,7 @@ my $strsth =
     AND reserves.priority <> 0 
     AND reserves.suspend = 0
     AND notforloan = 0 AND itemlost = 0 AND withdrawn = 0
+    AND default_branch_item_rules.holdallowed != 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