From 6f60fa35b49fd129f2b9ca351b502ba63daf3f40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Fri, 5 Mar 2021 17:26:02 +0200 Subject: [PATCH] Bug 27058: (follow-up) Clarify notforloan checks with a comment In IsAvailableForItemLevelRequest the check is for holdability and in ItemsAnyAvailableAndNotRestricted the check is for checkoutability. These comments should make it more clear because the notforloan value is used for these two different purposes and is a bit confusing (we might want to add a new field "notforhold" in future to make the code self documenting) Signed-off-by: Jonathan Druart (cherry picked from commit 9dcceb66fabc7569040c61fc7838d7d5e888e596) Signed-off-by: Fridolin Somers --- C4/Reserves.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 7be8ff0b8b..9e6eedc71d 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1317,7 +1317,7 @@ sub IsAvailableForItemLevelRequest { return 0 if $notforloan_per_itemtype || $item->itemlost || - $item->notforloan > 0 || + $item->notforloan > 0 || # item with negative or zero notforloan value is holdable $item->withdrawn || ($item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems')); @@ -1378,7 +1378,7 @@ sub ItemsAnyAvailableAndNotRestricted { # we can return (end the loop) when first one found: return 1 unless $i->itemlost - || $i->notforloan + || $i->notforloan # items with non-zero notforloan cannot be checked out || $i->withdrawn || $i->onloan || IsItemOnHoldAndFound( $i->id ) -- 2.39.5