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 <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Joonas Kylmälä 2021-03-05 17:26:02 +02:00 committed by Jonathan Druart
parent 8c68fa762e
commit 9dcceb66fa
1 changed files with 2 additions and 2 deletions

View File

@ -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 )