From b3ba5b958b9d70e72c31696f517135e6e4c1321c Mon Sep 17 00:00:00 2001
From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Date: Tue, 6 Feb 2024 13:42:34 +0000
Subject: [PATCH] Bug 36002: Remove unused subroutine GetParcels
That did refer to our aqorders.purchaseordernumber..
Test plan:
Git grep for GetParcels.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
---
C4/Acquisition.pm | 93 -----------------------------------------------
1 file changed, 93 deletions(-)
diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm
index 370030895ef..6824bd86371 100644
--- a/C4/Acquisition.pm
+++ b/C4/Acquisition.pm
@@ -72,8 +72,6 @@ BEGIN {
TransferOrder
ModItemOrder
- GetParcels
-
GetInvoices
GetInvoice
GetInvoiceDetails
@@ -1965,97 +1963,6 @@ sub get_rounded_price {
return $price;
}
-
-=head2 FUNCTIONS ABOUT PARCELS
-
-=head3 GetParcels
-
- $results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto);
-
-get a lists of parcels.
-
-* Input arg :
-
-=over
-
-=item $bookseller
-is the bookseller this function has to get parcels.
-
-=item $order
-To know on what criteria the results list has to be ordered.
-
-=item $code
-is the booksellerinvoicenumber.
-
-=item $datefrom & $dateto
-to know on what date this function has to filter its search.
-
-=back
-
-* return:
-a pointer on a hash list containing parcel informations as such :
-
-=over
-
-=item Creation date
-
-=item Last operation
-
-=item Number of biblio
-
-=item Number of items
-
-=back
-
-=cut
-
-sub GetParcels {
- my ($bookseller,$order, $code, $datefrom, $dateto) = @_;
- my $dbh = C4::Context->dbh;
- my @query_params = ();
- my $strsth ="
- SELECT aqinvoices.invoicenumber,
- datereceived,purchaseordernumber,
- count(DISTINCT biblionumber) AS biblio,
- sum(quantity) AS itemsexpected,
- sum(quantityreceived) AS itemsreceived
- FROM aqorders LEFT JOIN aqbasket ON aqbasket.basketno = aqorders.basketno
- LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid
- WHERE aqbasket.booksellerid = ? and datereceived IS NOT NULL
- ";
- push @query_params, $bookseller;
-
- if ( defined $code ) {
- $strsth .= ' and aqinvoices.invoicenumber like ? ';
- # add a % to the end of the code to allow stemming.
- push @query_params, "$code%";
- }
-
- if ( defined $datefrom ) {
- $strsth .= ' and datereceived >= ? ';
- push @query_params, $datefrom;
- }
-
- if ( defined $dateto ) {
- $strsth .= 'and datereceived <= ? ';
- push @query_params, $dateto;
- }
-
- $strsth .= "group by aqinvoices.invoicenumber,datereceived ";
-
- # can't use a placeholder to place this column name.
- # but, we could probably be checking to make sure it is a column that will be fetched.
- $strsth .= "order by $order " if ($order);
-
- my $sth = $dbh->prepare($strsth);
-
- $sth->execute( @query_params );
- my $results = $sth->fetchall_arrayref({});
- return @{$results};
-}
-
-#------------------------------------------------------------#
-
=head3 GetHistory
\@order_loop = GetHistory( %params );
--
2.39.2