From e1b92345cdb30a055f1788c57447451ddf8f40a9 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 18 Feb 2021 14:45:38 +0000 Subject: [PATCH] Bug 24446: (QA follow-up) Use 'receive' method in ModReserveAffect ModeReserveAffect was setting all transfers in the queue to received by looping through a resultset. This patch updates the logic to try and catch the in_transit transfer and receive just that one instead. Signed-off-by: Jonathan Druart --- C4/Reserves.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index db236947c5..d5f90494eb 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1200,16 +1200,11 @@ sub ModReserveAffect { } else { $hold->set_waiting($desk_id); _koha_notify_reserve( $hold->reserve_id ) unless $already_on_shelf; - my $transfers = Koha::Item::Transfers->search({ - itemnumber => $itemnumber, - datearrived => undef - }); - while( my $transfer = $transfers->next ){ - $transfer->datearrived( dt_from_string() )->store; - }; + # Complete transfer if one exists + my $transfer = $hold->item->get_transfer; + $transfer->receive if $transfer; } - _FixPriority( { biblionumber => $biblionumber } ); my $item = Koha::Items->find($itemnumber); if ( $item->location && $item->location eq 'CART' -- 2.39.5