Bug 21385: (follow-up) make query consistent
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Sep 2018 12:33:59 +0000 (13:33 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 8 Oct 2018 08:26:20 +0000 (09:26 +0100)
The expected items query wasn't consistent with other queries in this
module with regards to identifying cancelled orders

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 5e6f4f1f4fb346351dcfc6c580888022641d4b6a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Acquisition.pm

index 002c794..b20b9a1 100644 (file)
@@ -700,7 +700,7 @@ sub GetBasketsInfosByBookseller {
           COUNT(DISTINCT aqorders.biblionumber) AS total_biblios,
           SUM(
             IF(aqorders.datereceived IS NULL
-              AND aqorders.datecancellationprinted IS NULL
+              AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
             , aqorders.quantity
             , 0)
           ) AS expected_items