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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Marcel de Rooy 2024-02-06 13:42:34 +00:00 committed by Katrin Fischer
parent 1baa0c2876
commit 34e27c191b
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 0 additions and 93 deletions

View File

@ -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 );