From 32f8b00dabd50231473019ecf06d243f745a494b Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 29 May 2013 22:47:21 +0000 Subject: skip empty lines in the report --- en/about/reports/2013/mageia-financial-report-2013.csv | 2 +- en/about/reports/template.php | 6 ++++++ en/about/reports/template_lib.php | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'en') diff --git a/en/about/reports/2013/mageia-financial-report-2013.csv b/en/about/reports/2013/mageia-financial-report-2013.csv index 4d09fbc75..a90ef0aa6 100644 --- a/en/about/reports/2013/mageia-financial-report-2013.csv +++ b/en/about/reports/2013/mageia-financial-report-2013.csv @@ -57,7 +57,7 @@ month,count,total amount,check,transfer,paypal,cash 9,0,0.0,0.0,0.0,0.0,0.0, 10,0,0.0,0.0,0.0,0.0,0.0, 11,0.0,0.0,0.0,0.0,0.0,0.0, - +12,0.0,0.0,0.0,0.0,0.0,0.0, ## Other revenues date,description,amount diff --git a/en/about/reports/template.php b/en/about/reports/template.php index 5c0c04994..2cd6e6aeb 100644 --- a/en/about/reports/template.php +++ b/en/about/reports/template.php @@ -73,6 +73,9 @@ $count = array_fill(1, 12, 0); $tmp = $parsed['# Expenses details > ## More details']; array_shift($tmp); foreach ($tmp as $line) { + if (count($line) < 4) + continue; + $month = date('n', strtotime($line[0])); $list[$month] += $line[3]; // amount $count[$month] += 1; @@ -91,6 +94,9 @@ $count = array(); // FIXME take ## Other revenues lines into account. foreach ($parsed['# Income details > ## Donations monthly summary'] as $line) { + if (count($line) < 3) + continue; + $list[] = $line[2]; $count[] = $line[1]; } diff --git a/en/about/reports/template_lib.php b/en/about/reports/template_lib.php index 37c101971..419ff103c 100644 --- a/en/about/reports/template_lib.php +++ b/en/about/reports/template_lib.php @@ -94,6 +94,9 @@ function get_revenues($v, $_months) ); foreach ($v as $line) { + if (count($line) < 2) + continue; + $html .= sprintf('%s%s %s %s -- cgit v1.2.1