Exclude only replaced (duplicated) invoices.

This commit is contained in:
Laurent Destailleur 2009-11-29 13:13:02 +00:00
parent ccb14879e8
commit 957318f9d2

View File

@ -69,9 +69,9 @@ class FactureStats extends Stats
} }
$this->socid = $socid; $this->socid = $socid;
$this->where =" fk_statut > 0"; $this->where = " fk_statut > 0";
$this->where.= " AND entity = ".$conf->entity; $this->where.= " AND entity = ".$conf->entity;
if ($mode == 'customer') $this->where.=" AND fk_statut != 3"; // Exclude replaced invoices if ($mode == 'customer') $this->where.=" AND (fk_statut != 3 OR close_code != 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)
if ($this->socid) if ($this->socid)
{ {
$this->where.=" AND fk_soc = ".$this->socid; $this->where.=" AND fk_soc = ".$this->socid;