From 04ba83cdee2ba66902bec642d825c8a9fae622ef 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 8d32b353aff..98a670947b3 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2253,8 +2253,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