From 9dcceb66fabc7569040c61fc7838d7d5e888e596 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 --- C4/Reserves.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 75a978b4a6..e27b30e6a2 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1312,7 +1312,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')); @@ -1373,7 +1373,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