diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-06-05 20:45:24 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-06-05 20:45:24 +0000 |
commit | 84671e469d59bdd1095ed3b580444ed7ef3e1119 (patch) | |
tree | 7cc2aa66182329ca39a6a9dcff2891a6829c1421 /en/about | |
parent | 3858f106228557983630694a9e871422ec671b5e (diff) | |
download | www-84671e469d59bdd1095ed3b580444ed7ef3e1119.tar www-84671e469d59bdd1095ed3b580444ed7ef3e1119.tar.gz www-84671e469d59bdd1095ed3b580444ed7ef3e1119.tar.bz2 www-84671e469d59bdd1095ed3b580444ed7ef3e1119.tar.xz www-84671e469d59bdd1095ed3b580444ed7ef3e1119.zip |
real fix
Diffstat (limited to 'en/about')
-rw-r--r-- | en/about/reports/template.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/en/about/reports/template.php b/en/about/reports/template.php index 914564fe6..86b6ca197 100644 --- a/en/about/reports/template.php +++ b/en/about/reports/template.php @@ -114,19 +114,22 @@ $flow['revenue_op'] = $count; $qarr = array(); foreach ($flow['revenue'] as $month => $val) { + // save monthly data $arr[] = sprintf("['%s', %s, %s]", $_months[$month], str_replace(',', '.', $val), str_replace(',', '.', $flow['expenses'][$month])); - if ($i == 4) { + // sum quarterly data + $qRevenues += str_replace(',', '.', $val); + $qExpenses += str_replace(',', '.', $flow['expenses'][$month]); + + // save quarterly data + if ($i % 3 == 0) { $qarr[] = sprintf("['%s', %s, %s]", 'Q' . $j, $qRevenues, $qExpenses); + $qRevenues = 0; $qExpenses = 0; - $i = 1; $j += 1; } - $qRevenues += str_replace(',', '.', $val); - $qExpenses += str_replace(',', '.', $flow['expenses'][$month]); - $i += 1; } echo implode(', ', $arr); |