From 9a5927c322e2949f8b86461499bcc247a6572154 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 Nov 2020 13:59:46 +0100 Subject: [PATCH] Bug 26997: Remove 0000-00-00 from aqorders.datecancellationprinted This patch remove the 0000-00-00 from the WHERE condition from ordered.pl and spent.pl to prevent an error under MySQL 8 It also fixes the wrong values in DB (if possible, ie. under other DBMS that MySQL 8) Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 0e0700a691621b2ef1de46fa0ea18ee771daadaf) Signed-off-by: Fridolin Somers (cherry picked from commit e6aeb00c1059736c535a45d1a551eaa22c20b01f) Signed-off-by: Andrew Fuerste-Henry --- acqui/ordered.pl | 3 +-- acqui/spent.pl | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/acqui/ordered.pl b/acqui/ordered.pl index a3b3436049..e288dbe4d4 100755 --- a/acqui/ordered.pl +++ b/acqui/ordered.pl @@ -71,8 +71,7 @@ LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id WHERE budget_id=? AND - (datecancellationprinted IS NULL OR - datecancellationprinted='0000-00-00') AND + datecancellationprinted IS NULL AND (quantity > quantityreceived OR quantityreceived IS NULL) GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, tleft, diff --git a/acqui/spent.pl b/acqui/spent.pl index e69f41e9e4..7e773fec03 100755 --- a/acqui/spent.pl +++ b/acqui/spent.pl @@ -80,8 +80,7 @@ LEFT JOIN aqbooksellers ON WHERE aqorders.basketno=aqbasket.basketno AND budget_id=? AND - (datecancellationprinted IS NULL OR - datecancellationprinted='0000-00-00') AND + datecancellationprinted IS NULL AND datereceived IS NOT NULL GROUP BY aqorders.biblionumber, aqorders.basketno, aqorders.ordernumber, tleft, -- 2.39.5