Bug 6355: Correct GetLateOrders so it ignores cancelled orders github/bug_6355 origin/new/bug_6355
authorFrédérick Capovilla <frederick.capovilla@sys-tech.net>
Tue, 17 May 2011 15:39:11 +0000 (11:39 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Fri, 10 Jun 2011 03:42:30 +0000 (15:42 +1200)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing plan copied from bug:
- Create a new basket for a bookseller
- Create two new order in this basket. The orders must have a price or else
they won't be shown in the "Late orders" report.
- Delete one of the two orders.
- Close the basket
- Check for late orders and use "0 days ago" as a filter date.
- The deleted item appears in the report.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Acquisition.pm

index 45c1948..cd1e670 100644 (file)
@@ -1435,6 +1435,7 @@ sub GetLateOrders {
             OR datereceived IS NULL
             OR aqorders.quantityreceived < aqorders.quantity
         )
+        AND (aqorders.datecancellationprinted IS NULL OR aqorders.datecancellationprinted='0000-00-00')
     ";
     my $having = "";
     if ($dbdriver eq "mysql") {