Fix supplementaire fk_statut

This commit is contained in:
ywarnier 2007-02-28 23:24:57 +00:00
parent e7804fef1c
commit 0bd9ba5dc2
3 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ print '<table width="100%"><tr><td valign="top">';
$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 '</td><td valign="top">';
$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";
}

View File

@ -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";

View File

@ -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";
}