From dd800d4867469722767dc0932b86d337cc0482e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Feb 2004 17:38:37 +0000 Subject: [PATCH] Ajout ligne "Total" sur la page du chiffre d'affaire. --- htdocs/compta/stats/index.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 53d30fd270d..638a8c78bb2 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -35,7 +35,7 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } -print_titre("Chiffres d'affaires (".MAIN_MONNAIE." HT)"); +print_titre("Chiffre d'affaire (".MAIN_MONNAIE." HT)"); $sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; @@ -80,8 +80,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ''.$annee.''; } -print ' '; - +print ''; for ($mois = 1 ; $mois < 13 ; $mois++) { $var=!$var; @@ -97,11 +96,21 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) print price($cum[$case]); } print ""; + $total[$annee]+=$cum[$case]; } print ''; } +// Affiche total +print "Total : "; +for ($annee = $year_start ; $annee <= $year_end ; $annee++) +{ + print "".($total[$annee]?$total[$annee]:" ").""; +} +print "\n"; + + print ""; $db->close();