FIX Stats on invoices show nothing

This commit is contained in:
Laurent Destailleur 2017-10-17 11:08:49 +02:00
parent 5998f60764
commit 81e7f45200
2 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ class FactureStats extends Stats
var $from; var $from;
var $field; var $field;
var $where; var $where;
/** /**
* Constructor * Constructor
@ -56,8 +56,8 @@ class FactureStats extends Stats
$this->db = $db; $this->db = $db;
$this->socid = ($socid > 0 ? $socid : 0); $this->socid = ($socid > 0 ? $socid : 0);
$this->userid = $userid; $this->userid = $userid;
$this->cachefilesuffix = $mode; $this->cachefilesuffix = $mode;
if ($mode == 'customer') if ($mode == 'customer')
{ {
$object=new Facture($this->db); $object=new Facture($this->db);
@ -195,7 +195,7 @@ class FactureStats extends Stats
return $this->_getAllByYear($sql); return $this->_getAllByYear($sql);
} }
/** /**
* Return nb, amount of predefined product for year * Return nb, amount of predefined product for year
* *
@ -218,7 +218,7 @@ class FactureStats extends Stats
return $this->_getAllByProduct($sql); return $this->_getAllByProduct($sql);
} }
} }

View File

@ -84,7 +84,7 @@ dol_mkdir($dir);
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
if ($mode == 'customer') if ($mode == 'customer')
{ {
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {