From 206a3ba78c997cfe7fabea9723e906879a4fd6c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 May 2005 00:59:14 +0000 Subject: [PATCH] =?UTF-8?q?Corrections=20mauvais=20r=E9sultat=20du=20ca=20?= =?UTF-8?q?par=20utilisateur=20et=20support=20des=202=20modes=20comptables?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/stats/index.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index e596db7a083..e45159dde09 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -60,7 +60,7 @@ $html=new Form($db); // Affiche en-tête du rapport if ($modecompta=="CREANCES-DETTES") { - $nom="Chiffre d'affaire (".$conf->monnaie." HT)"; + $nom="Chiffre d'affaire"; $nom.=' (Voir le rapport recettes-dépenses pour n\'inclure que les factures effectivement payées)'; $period=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCADue"); @@ -68,7 +68,7 @@ if ($modecompta=="CREANCES-DETTES") $exportlink=$langs->trans("NotYetAvailable"); } else { - $nom="Chiffre d'affaire (".$conf->monnaie." TTC)"; + $nom="Chiffre d'affaire"; $nom.=' (Voir le rapport en créances-dettes pour inclure les factures non encore payée)'; $period=($year_start?"".img_previous()." ".img_next()."":""); $description=$langs->trans("RulesCAIn"); @@ -87,7 +87,7 @@ if ($modecompta == 'CREANCES-DETTES') { * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * vieilles versions, ils n'étaient pas liés via paiement_facture. On les ajoute plus loin) */ - $sql = "SELECT sum(pf.amount) as amount, date_format(p.datep,'%Y-%m') as dm"; + $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; $sql .= " WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid"; } @@ -102,8 +102,8 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); - $cum[$obj->dm] = $obj->amount; - if ($obj->amount) + $cum[$obj->dm] = $obj->amount_ttc; + if ($obj->amount_ttc) { $minyearmonth=($minyearmonth?min($minyearmonth,$obj->dm):$obj->dm); $maxyearmonth=max($maxyearmonth,$obj->dm); @@ -118,7 +118,7 @@ else { // On ajoute les paiements anciennes version, non liés par paiement_facture if ($modecompta != 'CREANCES-DETTES') { - $sql = "SELECT sum(p.amount) as amount, date_format(p.datep,'%Y-%m') as dm"; + $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql .= " WHERE pf.rowid IS NULL"; @@ -132,8 +132,8 @@ if ($modecompta != 'CREANCES-DETTES') { while ($i < $num) { $obj = $db->fetch_object($result); - $cum[$obj->dm] += $obj->amount; - if ($obj->amount) + $cum[$obj->dm] += $obj->amount_ttc; + if ($obj->amount_ttc) { $minyearmonth=($minyearmonth?min($minyearmonth,$obj->dm):$obj->dm); $maxyearmonth=max($maxyearmonth,$obj->dm); @@ -163,7 +163,7 @@ print ''; print ''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''.$langs->trans("Amount").''; + print ''.$langs->trans("AmountTTC").''; print ''.$langs->trans("Delta").''; print ' '; } @@ -403,6 +403,6 @@ print ""; $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?>