diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index 1219a83d9e0..9fb17eb25f2 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -61,6 +61,7 @@ class FichinterStats extends Stats $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->where.= " c.entity = ".$conf->entity; if ($mode == 'customer') { $object=new Fichinter($this->db); @@ -68,10 +69,8 @@ class FichinterStats extends Stats $this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl"; $this->field='0'; $this->field_line='0'; - $this->where.= " c.fk_statut > 0"; // Not draft and not cancelled + //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } - //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - $this->where.= " AND c.entity = ".$conf->entity; 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/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 5cdd7923cbd..c053239de1c 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -47,6 +47,8 @@ $year = GETPOST('year')>0?GETPOST('year'):$nowyear; $startyear=$year-1; $endyear=$year; +$object_status=GETPOST('object_status'); + $langs->load('interventions'); $langs->load('companies'); $langs->load('other'); @@ -58,6 +60,7 @@ $langs->load('suppliers'); */ $form=new Form($db); +$objectstatic=new FichInter($db); if ($mode == 'customer') { @@ -72,6 +75,7 @@ print load_fiche_titre($title,'','title_commercial.png'); dol_mkdir($dir); $stats = new FichinterStats($db, $socid, $mode, ($userid>0?$userid:0)); +if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')'; // Build graphic number of object $data = $stats->getNbByMonthWithPrevYear($endyear,$startyear); @@ -249,6 +253,12 @@ print '