diff --git a/htdocs/compta/stats/cumul.php b/htdocs/compta/stats/cumul.php index 20d4c560657..c1d77292009 100644 --- a/htdocs/compta/stats/cumul.php +++ b/htdocs/compta/stats/cumul.php @@ -49,7 +49,7 @@ print '
| '; $sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql .= " WHERE f.fk_statut = 1"; +$sql .= " WHERE f.fk_statut in (1,2)"; if ($conf->compta->mode != 'CREANCES-DETTES') { $sql .= " AND f.paye = 1"; @@ -66,7 +66,7 @@ print ' | '; $sql = "SELECT sum(f.total) as amount, year(f.datef) as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql .= " WHERE f.fk_statut = 1"; +$sql .= " WHERE f.fk_statut in (1,2)"; if ($conf->compta->mode != 'CREANCES-DETTES') { $sql .= " AND f.paye = 1"; } diff --git a/htdocs/compta/stats/exercices.php b/htdocs/compta/stats/exercices.php index 544359df820..4a624ad56d9 100644 --- a/htdocs/compta/stats/exercices.php +++ b/htdocs/compta/stats/exercices.php @@ -187,7 +187,7 @@ function ppt ($db, $year, $socid) $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_statut = 1"; + $sql .= " WHERE f.fk_statut in (1,2)"; $sql .= " AND date_format(f.datef,'%Y') = ".($year-1); if ($conf->compta->mode != 'CREANCES-DETTES') { @@ -205,7 +205,7 @@ function ppt ($db, $year, $socid) $sql = "SELECT sum(f.total) as sum, round(date_format(f.datef, '%m')) as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_statut = 1"; + $sql .= " WHERE f.fk_statut in (1,2)"; $sql .= " AND date_format(f.datef,'%Y') = $year "; if ($conf->compta->mode != 'CREANCES-DETTES') { $sql .= " AND f.paye = 1"; diff --git a/htdocs/compta/stats/lib.inc.php b/htdocs/compta/stats/lib.inc.php index 8fd3b1f8f4e..d2cf3980c5a 100644 --- a/htdocs/compta/stats/lib.inc.php +++ b/htdocs/compta/stats/lib.inc.php @@ -47,7 +47,7 @@ function get_ca ($db, $year, $socid) { $sql = "SELECT sum(f.amount) as sum FROM ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.fk_statut = 1"; + $sql .= " WHERE f.fk_statut in (1,2)"; if ($conf->compta->mode != 'CREANCES-DETTES') { $sql .= " AND f.paye = 1"; } |