From da470332493ae59f7caab358b1cd2ac2204cf5c0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 Aug 2022 15:33:13 +0200 Subject: [PATCH] Bug 31328: Call get_transfers from get_transfer Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- Koha/Item.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index d76722414d..68b590860a 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -570,12 +570,7 @@ we still expect the item to end up at a final location eventually. sub get_transfer { my ($self) = @_; - my $transfers_rs = Koha::Item::Transfers - ->_new_from_dbic(scalar $self->_result->branchtransfers) - ->filter_by_current - ->search( {}, { order_by => [ { -desc => 'datesent' }, { -asc => 'daterequested' } ], rows => 1 } ); - - return $transfers_rs->next; + return $self->get_transfers->search( {}, { rows => 1 } )->next; } =head3 get_transfers -- 2.39.5