From 122a9532ea06654f8cb63c4023e281aeaa8b687d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Apr 2005 00:45:40 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Corrections=20sur=20les=20rapports=20r?= =?UTF-8?q?=E9sultats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/resultat/index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index dc69a4955ae..bc12bcacf79 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -157,7 +157,7 @@ else { */ if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(s.amount) as amount_ht, sum(s.amount) as amount_ttc, date_format(s.date_ech,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s"; $sql .= " WHERE s.fk_type = c.id AND c.deductible=0"; if ($year) { @@ -166,7 +166,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " GROUP BY c.libelle"; } else { - $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(p.amount) as amount_ht, sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s, ".MAIN_DB_PREFIX."paiementcharge as p"; $sql .= " WHERE p.fk_charge = s.rowid AND s.fk_type = c.id AND c.deductible=0"; if ($year) { @@ -183,8 +183,8 @@ if ($result) { while ($i < $num) { $obj = $db->fetch_object($result); - $decaiss[$row->dm] += $row->amount_ht; - $decaiss_ttc[$row->dm] += $row->amount_ttc; + $decaiss[$obj->dm] += $obj->amount_ht; + $decaiss_ttc[$obj->dm] += $obj->amount_ttc; $i++; } @@ -199,7 +199,7 @@ if ($result) { */ if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT c.libelle as nom, sum(s.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(s.amount) as amount_ht, sum(s.amount) as amount_ttc, date_format(s.date_ech,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s"; $sql .= " WHERE s.fk_type = c.id AND c.deductible=1"; if ($year) { @@ -208,7 +208,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " GROUP BY c.libelle DESC"; } else { - $sql = "SELECT c.libelle as nom, sum(p.amount) as amount"; + $sql = "SELECT c.libelle as nom, sum(p.amount) as amount_ht, sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s, ".MAIN_DB_PREFIX."paiementcharge as p"; $sql .= " WHERE p.fk_charge = s.rowid AND s.fk_type = c.id AND c.deductible=1"; if ($year) { @@ -225,8 +225,8 @@ if ($result) { while ($i < $num) { $obj = $db->fetch_object($result); - $decaiss[$row->dm] += $row->amount_ht; - $decaiss_ttc[$row->dm] += $row->amount_ttc; + $decaiss[$obj->dm] += $obj->amount_ht; + $decaiss_ttc[$obj->dm] += $obj->amount_ttc; $i++; }