diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 747bb75433c..8f71447ab0b 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -79,7 +79,7 @@ class PropaleStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " p.fk_statut > 0"; + //$this->where .= " p.fk_statut > 0"; } if ($mode == 'supplier') { @@ -91,10 +91,10 @@ class PropaleStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " p.fk_statut > 0"; // Validated, accepted, refused and closed + //$this->where .= " p.fk_statut > 0"; // Validated, accepted, refused and closed } //$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity; - $this->where .= " AND p.entity IN (".getEntity('propal').")"; + $this->where .= ($this->where ? ' AND ' : '')."p.entity IN (".getEntity('propal').")"; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; if ($this->socid) { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 49e1141fec1..a59896c8ab6 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -86,7 +86,7 @@ if ($mode == 'customer') if ($mode == 'supplier') { $picto = 'supplier_proposal'; - $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; + $title = $langs->trans("ProposalsStatisticsSuppliers"); $dir = $conf->supplier_proposal->dir_temp; $cat_type = Categorie::TYPE_SUPPLIER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 5af5fb23060..c9dc5eaffa8 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -77,7 +77,7 @@ class CommandeStats extends Stats $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled + //$this->where .= " c.fk_statut > 0"; // Not draft and not cancelled } elseif ($mode == 'supplier') { $object = new CommandeFournisseur($this->db); @@ -85,10 +85,10 @@ class CommandeStats extends Stats $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field = 'total_ht'; $this->field_line = 'total_ht'; - $this->where .= " c.fk_statut > 2"; // Only approved & ordered + //$this->where .= " c.fk_statut > 2"; // Only approved & ordered } //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - $this->where .= ' AND c.entity IN ('.getEntity('commande').')'; + $this->where .= ($this->where ? ' AND ' : ''). 'c.entity IN ('.getEntity('commande').')'; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; if ($this->socid) diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 346b5549bfd..2b2402fd9de 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -81,7 +81,7 @@ $dir = $conf->commande->dir_temp; if ($mode == 'supplier') { $picto = 'supplier_order'; - $title = $langs->trans("OrdersStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; + $title = $langs->trans("OrdersStatisticsSuppliers"); $dir = $conf->fournisseur->commande->dir_temp; } diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index 1355c7a97cf..608b7d75f25 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -64,7 +64,6 @@ class FichinterStats extends Stats $this->userid = $userid; $this->cachefilesuffix = $mode; - $this->where .= " c.entity = ".$conf->entity; if ($mode == 'customer') { $object = new Fichinter($this->db); @@ -75,6 +74,8 @@ class FichinterStats extends Stats //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; + $this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')'; + if ($this->socid) { $this->where .= " AND c.fk_soc = ".$this->socid;