From aa766df8f9e36e07b57c3a283f966f1cf8f43315 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 8 Nov 2003 17:13:24 +0000 Subject: [PATCH] =?UTF-8?q?Ne=20comptabilise=20que=20les=20commandes=20val?= =?UTF-8?q?id=E9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/stats/commandestats.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stats/commandestats.class.php b/htdocs/product/stats/commandestats.class.php index 543b6f60cd9..5592745ace0 100644 --- a/htdocs/product/stats/commandestats.class.php +++ b/htdocs/product/stats/commandestats.class.php @@ -35,7 +35,7 @@ class CommandeStats Function getNbCommandeByYear() { $result = array(); - $sql = "SELECT date_format(date_commande,'%Y') as dm, count(*) FROM llx_commande GROUP BY dm DESC"; + $sql = "SELECT date_format(date_commande,'%Y') as dm, count(*) FROM llx_commande GROUP BY dm DESC WHERE fk_statut > 0"; if ($this->db->query($sql)) { $num = $this->db->num_rows(); @@ -59,7 +59,7 @@ class CommandeStats { $result = array(); $sql = "SELECT date_format(date_commande,'%m') as dm, count(*) FROM llx_commande"; - $sql .= " WHERE date_format(date_commande,'%Y') = $year"; + $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; if ($this->db->query($sql)) @@ -91,7 +91,7 @@ class CommandeStats { $result = array(); $sql = "SELECT date_format(date_commande,'%m') as dm, sum(total_ht) FROM llx_commande"; - $sql .= " WHERE date_format(date_commande,'%Y') = $year"; + $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; if ($this->db->query($sql)) @@ -123,7 +123,7 @@ class CommandeStats { $result = array(); $sql = "SELECT date_format(date_commande,'%m') as dm, avg(total_ht) FROM llx_commande"; - $sql .= " WHERE date_format(date_commande,'%Y') = $year"; + $sql .= " WHERE date_format(date_commande,'%Y') = $year AND fk_statut > 0"; $sql .= " GROUP BY dm DESC"; if ($this->db->query($sql))