Skip to content

Commit 62512dc

Browse files
mrenvoizetomascohen
authored andcommitted
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>
1 parent e6334cc commit 62512dc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

reserve/request.pl

+6-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ =head1 request.pl
3737
use C4::Items qw( get_hostitemnumbers_of );
3838
use C4::Koha qw( getitemtypeimagelocation );
3939
use C4::Serials qw( CountSubscriptionFromBiblionumber );
40-
use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule );
40+
use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule );
4141
use Koha::DateUtils qw( dt_from_string );
4242
use C4::Search qw( enabled_staff_search_views );
4343

@@ -450,13 +450,11 @@ =head1 request.pl
450450
}
451451

452452
# Check the transit status
453-
my ( $transfertwhen, $transfertfrom, $transfertto ) =
454-
GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer
455-
456-
if ( defined $transfertwhen && $transfertwhen ne '' ) {
457-
$item->{transfertwhen} = $transfertwhen;
458-
$item->{transfertfrom} = $transfertfrom;
459-
$item->{transfertto} = $transfertto;
453+
my $transfer = $item_object->get_transfer;
454+
if ( $transfer && $transfer->in_transit ) {
455+
$item->{transfertwhen} = $transfer->datesent;
456+
$item->{transfertfrom} = $transfer->frombranch;
457+
$item->{transfertto} = $transfer->tobranch;
460458
$item->{nocancel} = 1;
461459
}
462460

0 commit comments

Comments
 (0)