From 658c06e1bf5065a0e8ff9360e0944749220a1fd2 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 20 Jun 2012 08:34:14 +0000 Subject: [PATCH] [-] MO: StatsForecast: fix division by zero --- modules/statsforecast/statsforecast.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php index e51dd0fcd..512ee4473 100644 --- a/modules/statsforecast/statsforecast.php +++ b/modules/statsforecast/statsforecast.php @@ -375,7 +375,7 @@ class StatsForecast extends Module '.$payment['module'].' '.(int)$payment['nb'].'
'.($ca['ventil']['nb'] ? number_format((100 * $payment['nb'] / $ca['ventil']['nb']), 1, '.', ' ') : '0').' % - '.Tools::displayPrice($payment['total'], $currency).'
'.($ca['ventil']['total'] ? number_format((100 * $payment['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').' % + '.Tools::displayPrice($payment['total'], $currency).'
'.((int)$ca['ventil']['total'] ? number_format((100 * $payment['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').' % '.Tools::displayPrice($payment['cart'], $currency).' '; $this->_html .= ' @@ -400,7 +400,7 @@ class StatsForecast extends Module '.$catrow['orderQty'].' '.Tools::displayPrice($catrow['orderSum'], $currency).' '.number_format((100 * $catrow['orderQty'] / $this->t4), 1, '.', ' ').'% - '.($ca['ventil']['total'] ? number_format((100 * $catrow['orderSum'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% + '.((int)$ca['ventil']['total'] ? number_format((100 * $catrow['orderSum'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% '.Tools::displayPrice($catrow['priveAvg'], $currency).' '; $this->_html .= ' @@ -417,7 +417,7 @@ class StatsForecast extends Module '.$ophone.' '.Tools::displayPrice($amount, $currency).' - '.($ca['ventil']['total'] ? number_format((100 * $amount / $ca['ventil']['total']), 1, '.', ' ').'%' : '-').' + '.((int)$ca['ventil']['total'] ? number_format((100 * $amount / $ca['ventil']['total']), 1, '.', ' ').'%' : '-').' '.(($percent > 0 OR $percent == '∞') ? '' : ' ').' '.(($percent > 0 OR $percent == '∞') ? '+' : '').$percent.'% '; @@ -436,7 +436,7 @@ class StatsForecast extends Module '.(int)($zone['nb']).' '.Tools::displayPrice($zone['total'], $currency).' '.($ca['ventil']['nb'] ? number_format((100 * $zone['nb'] / $ca['ventil']['nb']), 1, '.', ' ') : '0').'% - '.($ca['ventil']['total'] ? number_format((100 * $zone['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% + '.((int)$ca['ventil']['total'] ? number_format((100 * $zone['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% '; $this->_html .= ' @@ -460,7 +460,7 @@ class StatsForecast extends Module '.(int)($currencyRow['nb']).' '.Tools::displayPrice($currencyRow['total'], $currency).' '.($ca['ventil']['nb'] ? number_format((100 * $currencyRow['nb'] / $ca['ventil']['nb']), 1, '.', ' ') : '0').'% - '.($ca['ventil']['total'] ? number_format((100 * $currencyRow['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% + '.((int)$ca['ventil']['total'] ? number_format((100 * $currencyRow['total'] / $ca['ventil']['total']), 1, '.', ' ') : '0').'% '; $this->_html .= '