Skip to content

Commit

Permalink
Fix Dolibarr#29843 warning division by zero (Dolibarr#29848)
Browse files Browse the repository at this point in the history
Co-authored-by: Hystepik <[email protected]>
  • Loading branch information
Hystepik and Hystepik authored Jun 9, 2024
1 parent 1baec9a commit 3c06fe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/compta/stats/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
if ($annee_decalage > $minyear && $case <= $casenow) {
if (!empty($cum[$caseprev]) && !empty($cum[$case])) {
if (!empty($cum[$caseprev]) && !empty($cum[$case]) && $cum[$caseprev] != 0) {
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
print($percent >= 0 ? "+$percent" : "$percent").'%';
Expand Down

0 comments on commit 3c06fe1

Please sign in to comment.