From ccc4c42760df2aec44e14da5cf4e3a546d6333c0 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 19 Nov 2023 21:50:41 +0000 Subject: [PATCH] Bug 32776: Stop recalled items from being recalled by other holds being converted on same record --- misc/cronjobs/recalls/convert_holds_to_recalls.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/cronjobs/recalls/convert_holds_to_recalls.pl b/misc/cronjobs/recalls/convert_holds_to_recalls.pl index 176fdd16760..961595b4da4 100755 --- a/misc/cronjobs/recalls/convert_holds_to_recalls.pl +++ b/misc/cronjobs/recalls/convert_holds_to_recalls.pl @@ -127,8 +127,8 @@ foreach my $bib ( @bib_holds ) { my $item_to_allocate = $itemnumber_to_allocate == $item->id ? $item : Koha::Items->find( $itemnumber_to_allocate ); do_convert( $hold_to_convert, $item_to_allocate ); report( $hold_to_convert, ++$count ); + $this_record_holds_converted++; } - $this_record_holds_converted++; } } } @@ -160,7 +160,7 @@ sub can_convert { } else { # bib-level reserve - if ( $item and $item->can_be_recalled({ patron => $patron, hold_convert => 1 }) ) { + if ( $item and $item->can_be_recalled({ patron => $patron, hold_convert => 1 }) and Koha::Recalls->filter_by_current->search({ item_id => $item->id })->count < 1 ) { # this item may be able to fill the recall return $item->id; } -- 2.30.2