From f1f54790dc251a5f51375b0000a339ad348c1d92 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sat, 29 Dec 2007 18:28:14 -0600 Subject: [PATCH] Fixing a bug with notforloan being checked properly Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1694444781..a689f8b6d0 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -715,6 +715,22 @@ sub CanBookBeIssued { { $issuingimpossible{NOT_FOR_LOAN} = 1; } + elsif ( !$item->{'notforloan'} ){ + # we have to check itemtypes.notforloan also + if (C4::Context->preference('item-level_itypes')){ + # this should probably be a subroutine + my $sth = $dbh->prepare("SELECT notforloan FROM itemtypes WHERE itemtype = ?"); + $sth->execute($item->{'itemtype'}); + my $notforloan=$sth->fetchrow_hashref(); + $sth->finish(); + if ($notforloan->{'notforloan'} == 1){ + $issuingimpossible{NOT_FOR_LOAN} = 1; + } + } + elsif ($biblioitem->{'notforloan'} == 1){ + $issuingimpossible{NOT_FOR_LOAN} = 1; + } + } if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} == 1 ) { $issuingimpossible{WTHDRAWN} = 1; -- 2.39.5