From b454e1a8947fe399879a928a7b05c62d993f1800 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Nov 2014 11:15:08 +0100 Subject: [PATCH] Bug 13318: Delete C4::Acq::GetParcel Test plan: git grep GetParcel should not return use of this subroutine. Signed-off-by: wajasu Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Acquisition.pm | 73 +---------------------------------------------- 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 22934e9216..1c9b3fe60f 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -66,7 +66,7 @@ BEGIN { &GetLastOrderNotReceivedFromSubscriptionid &GetLastOrderReceivedFromSubscriptionid &ModItemOrder - &GetParcels &GetParcel + &GetParcels &GetInvoices &GetInvoice @@ -1896,77 +1896,6 @@ sub TransferOrder { =head2 FUNCTIONS ABOUT PARCELS -=cut - -#------------------------------------------------------------# - -=head3 GetParcel - - @results = &GetParcel($booksellerid, $code, $date); - -Looks up all of the received items from the supplier with the given -bookseller ID at the given date, for the given code (bookseller Invoice number). Ignores cancelled and completed orders. - -C<@results> is an array of references-to-hash. The keys of each element are fields from -the aqorders, biblio, and biblioitems tables of the Koha database. - -C<@results> is sorted alphabetically by book title. - -=cut - -sub GetParcel { - #gets all orders from a certain supplier, orders them alphabetically - my ( $supplierid, $code, $datereceived ) = @_; - my $dbh = C4::Context->dbh; - my @results = (); - $code .= '%' - if $code; # add % if we search on a given code (otherwise, let him empty) - my $strsth =" - SELECT authorisedby, - creationdate, - aqbasket.basketno, - closedate,surname, - firstname, - aqorders.biblionumber, - aqorders.ordernumber, - aqorders.parent_ordernumber, - aqorders.quantity, - aqorders.quantityreceived, - aqorders.unitprice, - aqorders.listprice, - aqorders.rrp, - aqorders.ecost, - aqorders.gstrate, - biblio.title - FROM aqorders - LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno - LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber - LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber - LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid - WHERE - aqbasket.booksellerid = ? - AND aqinvoices.invoicenumber LIKE ? - AND aqorders.datereceived = ? "; - - my @query_params = ( $supplierid, $code, $datereceived ); - if ( C4::Context->preference("IndependentBranches") ) { - unless ( C4::Context->IsSuperLibrarian() ) { - $strsth .= " and (borrowers.branchcode = ? - or borrowers.branchcode = '')"; - push @query_params, C4::Context->userenv->{branch}; - } - } - $strsth .= " ORDER BY aqbasket.basketno"; - my $result_set = $dbh->selectall_arrayref( - $strsth, - { Slice => {} }, - @query_params); - - return @{$result_set}; -} - -#------------------------------------------------------------# - =head3 GetParcels $results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto); -- 2.39.5