Bug 24295: Remove GetTransfers from request.pl

This patch replaces the call to GetTransfers in reserve.pl 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 reserves page for the display of the current transfer
   status
4/ Apply patch
5/ Repeat step 3

Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2021-03-15 16:15:22 +00:00 committed by Tomas Cohen Arazi
parent e6334cc360
commit 62512dc5d6
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 6 additions and 8 deletions

View File

@ -37,7 +37,7 @@ use C4::Reserves qw( RevertWaitingStatus AlterPriority ToggleLowestPriority Togg
use C4::Items qw( get_hostitemnumbers_of );
use C4::Koha qw( getitemtypeimagelocation );
use C4::Serials qw( CountSubscriptionFromBiblionumber );
use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule );
use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule );
use Koha::DateUtils qw( dt_from_string );
use C4::Search qw( enabled_staff_search_views );
@ -450,13 +450,11 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
}
# Check the transit status
my ( $transfertwhen, $transfertfrom, $transfertto ) =
GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer
if ( defined $transfertwhen && $transfertwhen ne '' ) {
$item->{transfertwhen} = $transfertwhen;
$item->{transfertfrom} = $transfertfrom;
$item->{transfertto} = $transfertto;
my $transfer = $item_object->get_transfer;
if ( $transfer && $transfer->in_transit ) {
$item->{transfertwhen} = $transfer->datesent;
$item->{transfertfrom} = $transfer->frombranch;
$item->{transfertto} = $transfer->tobranch;
$item->{nocancel} = 1;
}