From c744611b41671aa37947f0d996abae6afb54d257 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Mar 2021 15:56:20 +0000 Subject: [PATCH] Bug 24295: Remove GetTransfers from opac-reserve.pl This patch replaces the call to GetTransfers in opac-reserve with the get_transfer method available from the Koha::Item object Test plan 1/ Place a reserve on an item at a different branch 2/ Trigger the transfer of the item 3/ Check the opac-reserves page for the display of the current transfer status 4/ Apply patch 5/ Repeat step 3 --- opac/opac-reserve.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 9b7680759d..1a615c3d81 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -535,12 +535,11 @@ foreach my $biblioNum (@biblionumbers) { } # Check of the transferred documents - my ( $transfertwhen, $transfertfrom, $transfertto ) = - GetTransfers($itemNum); - if ( $transfertwhen && ($transfertwhen ne '') ) { - $itemLoopIter->{transfertwhen} = output_pref({ dt => dt_from_string($transfertwhen), dateonly => 1 }); - $itemLoopIter->{transfertfrom} = $transfertfrom; - $itemLoopIter->{transfertto} = $transfertto; + my $transfer = $item->get_transfer; + if ( $transfer->in_transit ) { + $itemLoopIter->{transfertwhen} = output_pref({ dt => dt_from_string($transfer->datesent), dateonly => 1 }); + $itemLoopIter->{transfertfrom} = $transfer->frombranch; + $itemLoopIter->{transfertto} = $transfer->tobranch; $itemLoopIter->{nocancel} = 1; } -- 2.20.1