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 '
| '.$langs->trans("Month").' | '; $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 ''.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'% | '; + if ($cum[$caseprev]) { + $percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100); + print ''.($percent>=0?"+$percent":"$percent").'% | '; + + } else print '+Inf% | '; } @@ -151,7 +156,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) } // Affiche total -print "|
| Total : | "; +print "||||
| ".$langs->trans("Total")." : | "; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { print "".($total[$annee]?$total[$annee]:" ")." | "; @@ -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 ''.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'% | '; + if ($total[$annee-1]) { + $percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100); + print ''.($percent>=0?"+$percent":"$percent").'% | '; + } else print '+Inf% | '; }