From 7d30e64996100bf0fb5a803cd6e1dcdbd8f01e20 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 19 Oct 2018 12:18:19 -0300 Subject: [PATCH] Bug 21622: Adjust incorrect GROUP BY clauses in acqui script acqui/ordered.pl: GROUP BY aqorders.ordernumber acqui/spent.pl: GROUP BY aqorders.ordernumbe 'koha_kohadev.aqorders.biblionumber' isn't in GROUP BY Test plan: - Create orders for different basket and using different funds - Receive some of them - Hit the ordered and spent pages (from the acqui home page) => The tables must contain the same data with and without this patch Signed-off-by: Jasmine Amohia Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 2d904a55e7f0d5da23d61e5272e36a75e4b68af2) Signed-off-by: Martin Renvoize --- acqui/ordered.pl | 8 +++++++- acqui/spent.pl | 14 +++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/acqui/ordered.pl b/acqui/ordered.pl index 75291d9f5c..7366cca04d 100755 --- a/acqui/ordered.pl +++ b/acqui/ordered.pl @@ -74,7 +74,13 @@ WHERE (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00') AND (quantity > quantityreceived OR quantityreceived IS NULL) - GROUP BY aqorders.ordernumber + GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, + tleft, + ecost, budgetdate, entrydate, + aqbasket.booksellerid, + aqbooksellers.name, + itype, + title EOQ my $sth = $dbh->prepare($query); diff --git a/acqui/spent.pl b/acqui/spent.pl index 69a25379f9..6a47161a90 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -83,7 +83,19 @@ WHERE (datecancellationprinted IS NULL OR datecancellationprinted='0000-00-00') AND datereceived IS NOT NULL - GROUP BY aqorders.ordernumber + GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, + tleft, + ecost, budgetdate, entrydate, + aqbasket.booksellerid, + itype, + title, + aqorders.invoiceid, + aqinvoices.invoicenumber, + quantityreceived, + unitprice, + datereceived, + aqbooksellers.name + EOQ my $sth = $dbh->prepare($query); $sth->execute($bookfund); -- 2.39.5