diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 60302b96a8a..c3035128d5c 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -39,7 +39,9 @@ if ($user->societe_id > 0) $mode='recettes'; if ($conf->compta->mode == 'CREANCES-DETTES') { $mode='creances'; } + print_titre("Chiffre d'affaire (".$conf->monnaie." HT, ".$mode.")"); +print '
'; $sql = "SELECT sum(f.total) as amount , date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; @@ -66,7 +68,7 @@ if ($result) } } -print ''; +print '
'; print ''; $year_current = strftime("%Y",time()); @@ -126,8 +128,11 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) // Pourcentage evol if ($cum[$caseprev]) { if ($case <= $casenow) { - if ($cum[$caseprev]) - print ''; + if ($cum[$caseprev]) { + $percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100); + print ''; + + } else print ''; } @@ -151,7 +156,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } // Affiche total -print ""; +print ""; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print ""; @@ -159,8 +164,10 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) // Pourcentage evol if ($total[$annee-1]) { if ($annee <= $year_current) { - if ($total[$annee-1]) - print ''; + if ($total[$annee-1]) { + $percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100); + print ''; + } else print ''; }
'.$langs->trans("Month").''.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'%'.($percent>=0?"+$percent":"$percent").'%+Inf%
Total :
".$langs->trans("Total")." :".($total[$annee]?$total[$annee]:" ")."'.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'%'.($percent>=0?"+$percent":"$percent").'%+Inf%