From ee904c5664e234c6609a300df7af26f2c2a2fd56 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 21 Oct 2024 12:42:06 +0100 Subject: [PATCH] Bug 35721: Replace newly introduced ModItemTransfer calls --- circ/returns.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 4512460e975..bba0f57e34d 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -171,7 +171,10 @@ if ( $query->param('reserve_id') && $op eq 'cud-affect_reserve') { ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); if ($diffBranchSend) { - ModItemTransfer( $itemnumber, $userenv_branch, $diffBranchSend, 'Reserve' ); + my $tobranch = Koha::Libraries->find( $reserve->{branchcode} ); + # Add transfer, enqueue if one is already in the queue, and immediately set to in transit + my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); + $transfer->transit; } } # check if we have other reserves for this document, if we have a result send the message of transfer @@ -612,7 +615,10 @@ if ( $messages->{'ResFound'} ) { ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); if ($diffBranchSend) { - ModItemTransfer( $itemnumber, $item->holdingbranch, $reserve->{branchcode}, 'Reserve' ); + my $tobranch = Koha::Libraries->find( $reserve->{branchcode} ); + # Add transfer, enqueue if one is already in the queue, and immediately set to in transit + my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); + $transfer->transit; } $template->param( -- 2.47.0