Merge pull request #12819 from atm-arnaud/FIX_stats_invoices_with_draft

FIX drafts are now implemented for stats
This commit is contained in:
Laurent Destailleur 2020-01-10 00:15:13 +01:00 committed by GitHub
commit b93247aeec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ class FactureStats extends Stats
$this->field_line='total_ht';
}
$this->where = " f.fk_statut > 0";
$this->where = " f.fk_statut >= 0";
$this->where.= " AND f.entity IN (".getEntity('invoice').")";
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($mode == 'customer') $this->where.=" AND (f.fk_statut <> 3 OR f.close_code <> 'replaced')"; // Exclude replaced invoices as they are duplicated (we count closed invoices for other reasons)