From 5abf7731d8e81654149b349acea6e41d6f6fcba7 Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Tue, 4 Mar 2025 20:47:13 +0000 Subject: [PATCH] Bug 28530: (QA follow-up) correct item count and limit enforcement Corrected the count of items to limit to the current branch. Also set the limit to trigger when the count of items at the branch is currently at the limit before the item to be checked in. --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 49f625430d..90a1f4800a 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2250,8 +2250,8 @@ sub AddReturn { my $effective_itemtype = $item->effective_itemtype; my $limit = Koha::Library::FloatLimits->find( { itemtype => $effective_itemtype, branchcode => $branch } ); if ($limit) { - my $count = Koha::Items->count( { itype => $limit->itemtype } ); - if ( $count > $limit->float_limit ) { + my $count = Koha::Items->count( { itype => $limit->itemtype, holdingbranch => $branch } ); + if ( $count >= $limit->float_limit ) { my $transfer_branchcode = Koha::Library::FloatLimits->lowest_ratio_library( $item, $branch ); if ( $transfer_branchcode ne $branch ) { $returnbranch = $transfer_branchcode; -- 2.39.5