Bug 23397: Fix grouping of orders in acqui scripts

Bug 21622 attempted to fix some grouping for strict mode, however, it failed to take into account that single order can have multiple item types.

To recreate:
1 - Place an order for 4 copies of a title in acq
2 - Make sure you are creating orders when ordering (AcqCreateItems syspref and/or when creating basket)
3 - Set three items to one type, and one to another
4 - Go to Acqui-Home and click 'ordered' for the used budget
5 - Note the line is duplicated for each itemtype in the order
6 - Recieve the items and note the same issue on 'Spent'
7 - Place another order as before so you have the problem in both ordered.pl and spent/pl
8 - Apply patch
9 - Note orders are no longer duplicated

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-07-29 18:12:21 +00:00 committed by Martin Renvoize
parent 424cd4ed7f
commit 1f40de2931
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 2 additions and 4 deletions

View file

@ -58,7 +58,7 @@ SELECT
ecost_tax_included, budgetdate, entrydate,
aqbasket.booksellerid,
aqbooksellers.name as vendorname,
itype,
GROUP_CONCAT(DISTINCT itype),
title
FROM (aqorders, aqbasket)
LEFT JOIN biblio ON
@ -80,7 +80,6 @@ WHERE
ecost_tax_included, budgetdate, entrydate,
aqbasket.booksellerid,
aqbooksellers.name,
itype,
title
EOQ

View file

@ -59,7 +59,7 @@ SELECT
quantity-quantityreceived AS tleft,
budgetdate, entrydate,
aqbasket.booksellerid,
itype,
GROUP_CONCAT(DISTINCT itype),
title,
aqorders.invoiceid,
aqinvoices.invoicenumber,
@ -88,7 +88,6 @@ WHERE
tleft,
budgetdate, entrydate,
aqbasket.booksellerid,
itype,
title,
aqorders.invoiceid,
aqinvoices.invoicenumber,