From 7b215ecdeb5f6afe644111f4a9fbcf3da2d65db3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Dec 2016 14:04:17 +0100 Subject: [PATCH] Bug 17737: Remove C4::Reserves::GetReservesFromItemnumber At this point, there should not be any occurrences of GetReservesFromItemnumber anymore. --- C4/Reserves.pm | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 547c19e..5680a17 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -104,7 +104,6 @@ BEGIN { &AddReserve &GetReserve - &GetReservesFromItemnumber &GetReservesFromBorrowernumber &GetReservesForBranch &GetReservesToBranch @@ -275,46 +274,6 @@ sub GetReserve { return $sth->fetchrow_hashref(); } -=head2 GetReservesFromItemnumber - - ( $reservedate, $borrowernumber, $branchcode, $reserve_id, $waitingdate ) = GetReservesFromItemnumber($itemnumber); - -Get the first reserve for a specific item number (based on priority). Returns the abovementioned values for that reserve. - -The routine does not look at future reserves (read: item level holds), but DOES include future waits (a confirmed future hold). - -=cut - -sub GetReservesFromItemnumber { - my ($itemnumber) = @_; - - my $schema = Koha::Database->new()->schema(); - - my $r = $schema->resultset('Reserve')->search( - { - itemnumber => $itemnumber, - suspend => 0, - -or => [ - reservedate => \'<= CAST( NOW() AS DATE )', - waitingdate => { '!=', undef } - ] - }, - { - order_by => 'priority', - } - )->first(); - - return unless $r; - - return ( - $r->reservedate(), - $r->get_column('borrowernumber'), - $r->get_column('branchcode'), - $r->reserve_id(), - $r->waitingdate(), - ); -} - =head2 GetReservesFromBorrowernumber $borrowerreserv = GetReservesFromBorrowernumber($borrowernumber,$tatus); -- 2.1.4