diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 8eddb548449..7944f7b39ad 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -105,77 +105,84 @@ for ($mois = 1 ; $mois < 13 ; $mois++) print "".strftime("%B",mktime(1,1,1,$mois,1,2000)).""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - $casenow = strftime("%Y-%m",mktime()); + $casenow = strftime("%Y-%m",mktime()); $case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee)); $caseprev = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee-1)); - // Montant CA + + // Valeur CA + print ''; if ($cum[$case]) { - print price($cum[$case]); + print price($cum[$case],1); } - else { - if ($case <= $casenow) { print '0'; } - else { print ' '; } + else + { + if ($case <= $casenow) { print '0'; } + else { print ' '; } } print ""; - // Pourcentage evol - if ($cum[$caseprev]) { - if ($case <= $casenow) { - if ($cum[$caseprev]) - print ''.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'%'; - else - print '+Inf%'; - } - else { - print ' '; - } - } else { - if ($case <= $casenow) { - print '-'; - } - else { - print ' '; - } + // Pourcentage evol + if ($cum[$caseprev]) { + if ($case <= $casenow) { + if ($cum[$caseprev]) + print ''.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'%'; + else + print '+Inf%'; } - - $total[$annee]+=$cum[$case]; + else + { + print ' '; + } + } else { + if ($case <= $casenow) { + print '-'; + } + else { + print ' '; + } + } + + $total[$annee]+=$cum[$case]; } - - print ''; + + print ''; } // Affiche total print "Total :"; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print "".($total[$annee]?$total[$annee]:" ").""; - - // Pourcentage evol - if ($total[$annee-1]) { - if ($annee <= $year_current) { - if ($total[$annee-1]) - print ''.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'%'; - else - print '+Inf%'; - } - else { - print ' '; - } - } else { - if ($annee <= $year_current) { - print '-'; - } - else { - print ' '; - } + print "".($total[$annee]?$total[$annee]:" ").""; + + // Pourcentage evol + if ($total[$annee-1]) { + if ($annee <= $year_current) { + if ($total[$annee-1]) + print ''.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'%'; + else + print '+Inf%'; + } + else + { + print ' '; + } + } + else + { + if ($annee <= $year_current) + { + print '-'; } - + else + { + print ' '; + } + } + } print "\n"; - - print ""; $db->close();