From 3ca173fe405d9c786273fca0e372f4f9640224f3 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. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/Reserves.pm | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 1598eb6581..3192d50e69 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -104,7 +104,6 @@ BEGIN { &AddReserve &GetReserve - &GetReservesFromItemnumber &GetReservesFromBorrowernumber &GetReservesForBranch &GetReservesToBranch @@ -279,46 +278,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.39.5