From 9ad5054caa32162682783c6facf2a287b055c93a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 25 Mar 2024 20:47:37 +0000 Subject: [PATCH] Bug 36422: Only show rotating collection transfer warning if there are no holds on an item To Test: 1. Tools > Rotating collections 2. Set up a rotating collection from Branch A and transfer it to Branch B. 3. From Branch A put a hold on that same item for pickup a Branch A. 4. Check the item in to trigger the hold at Branch A. 5. Notice the modal says that the item is on hold and waiting correctly at Branch A. 6. The modal also says "Please transfer item to: Branch 2. This is part of a rotating collection". 7. APPLY PATCH 8. Try steps 3 - 5 again. This time there should be no info. about needing to transfer the item for the rotating collection. --- circ/returns.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circ/returns.pl b/circ/returns.pl index 5b119e3726..8908870d77 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -837,7 +837,8 @@ $template->param( if ( $barcode ) { my $item_from_barcode = Koha::Items->find({barcode => $barcode }); # How many times do we fetch this item?!? - if ( $item_from_barcode ) { + my $hold_count = $item_from_barcode->current_holds->search()->count; + if ( $item_from_barcode && !$hold_count ) { $itemnumber = $item_from_barcode->itemnumber; my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); if ( $holdingBranch and $collectionBranch ) { -- 2.30.2