From e433d6481c821fa9f5d7d3fbb18853799073d6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Thu, 19 Nov 2020 16:55:18 +0200 Subject: [PATCH] Bug 27058: Make checkout availability use all notforloan reasons The ItemsAnyAvailableAndNotRestricted function is checking whether an item can be checked out and it incorrectly only checks the positive notforloan values when there can be also negative notforloan values. If notforloan value is not 0 then it means the item cannot be checked out. In the case of ordered items the value is negative (-1) and thus before this change the checkout availability was reported incorrectly. --- C4/Reserves.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index c5a8d4ab53..a5a21146e3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1365,7 +1365,7 @@ sub ItemsAnyAvailableAndNotRestricted { # we can return (end the loop) when first one found: return 1 unless $i->itemlost - || $i->notforloan > 0 + || $i->notforloan || $i->withdrawn || $i->onloan || IsItemOnHoldAndFound( $i->id ) -- 2.11.0