From ad9b652c673c12374eb9617dcab09dc05f9f10f8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 13 Jul 2004 13:59:41 +0000 Subject: [PATCH] Ajout d'une fonction pour faire des stats sur les propales --- htdocs/product.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/product.class.php b/htdocs/product.class.php index a8e84a5570f..6a164ea7218 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -416,8 +416,8 @@ class Product return $this->_get_stats($sql); } - /* - * + /** + *Renvoie le nombre de facture dans lesquelles figure le produit * */ Function get_num_vente() @@ -427,6 +427,19 @@ class Product $sql .= " WHERE f.rowid = d.fk_facture and f.paye = 1 and d.fk_product =".$this->id; $sql .= " GROUP BY date_format(f.datef,'%Y%m') DESC ;"; + return $this->_get_stats($sql); + } + /** + *Renvoie le nombre de proaple dans lesquelles figure le produit + * + */ + Function get_num_propal() + { + $sql = "SELECT count(*), date_format(p.datep, '%Y%m') "; + $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."propal as p"; + $sql .= " WHERE p.rowid = d.fk_propal and d.fk_product =".$this->id; + $sql .= " GROUP BY date_format(p.datep,'%Y%m') DESC ;"; + return $this->_get_stats($sql); } /*