diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 1bc47ca4f2c..3836bdf2f78 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -852,6 +852,8 @@ class Product */ function load_stats_commande($socid=0) { + global $conf; + $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; $sql.= " COUNT(cd.rowid) as nb_rows, SUM(cd.qty) as qty"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."product as p,";