From 98e2db8278ac72aeb30a815502c083f7e2fb6ffc Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 23 Jun 2008 11:15:01 -0500 Subject: [PATCH] bug 2273: not-for-loan item should not fill hold request If an item is not for loan (i.e., items.notforloan is not null), do not use it to fill a title-level hold request when item is checked in. Prior to this patch, a notforloan item could fill a request - CheckReserves() was checking only the item's item type's not for loan flag. Signed-off-by: Joshua Ferraro --- C4/Reserves.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index ae07e4edb6..f011b9e622 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -607,7 +607,7 @@ sub CheckReserves { my $qitem = $dbh->quote($item); # Look up the item by itemnumber my $query = " - SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan + SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan, items.notforloan AS itemnotforloan FROM items LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype @@ -619,7 +619,7 @@ sub CheckReserves { my $qbc = $dbh->quote($barcode); # Look up the item by barcode my $query = " - SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan + SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan, items.notforloan AS itemnotforloan FROM items LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype @@ -632,11 +632,11 @@ sub CheckReserves { # FIXME - This function uses $item later on. Ought to set it here. } $sth->execute; - my ( $biblio, $bibitem, $notforloan ) = $sth->fetchrow_array; + my ( $biblio, $bibitem, $notforloan_per_itemtype, $notforloan_per_item ) = $sth->fetchrow_array; $sth->finish; # if item is not for loan it cannot be reserved either..... - return ( 0, 0 ) if $notforloan; + return ( 0, 0 ) if $notforloan_per_item or $notforloan_per_itemtype; # get the reserves... # Find this item in the reserves -- 2.39.5