From 0baaab3a9b336b5bf83ae68685f677f090d14e83 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. Signed-off-by: Kris Becker --- 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