From a9373682ce09fe316c7622fd0d657a552d33009d Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Fri, 11 May 2012 10:10:23 +0000 Subject: updated fi report section (layout) --- en/about/reports/2010/index.php | 5 +- en/about/reports/2011/index.php | 335 ++---------------- .../reports/2011/mageia-financial-report-2011.csv | 11 +- en/about/reports/2012/index.php | 29 ++ .../reports/2012/mageia-financial-report-2012.csv | 85 +++++ en/about/reports/index.php | 5 +- en/about/reports/template.php | 373 +++++++++++++++++++++ 7 files changed, 518 insertions(+), 325 deletions(-) create mode 100644 en/about/reports/2012/index.php create mode 100644 en/about/reports/2012/mageia-financial-report-2012.csv create mode 100644 en/about/reports/template.php (limited to 'en') diff --git a/en/about/reports/2010/index.php b/en/about/reports/2010/index.php index 5abac7999..2e822d485 100644 --- a/en/about/reports/2010/index.php +++ b/en/about/reports/2010/index.php @@ -9,11 +9,10 @@ - + - +

Activity Reports » 2010 Financial Report

-
diff --git a/en/about/reports/2011/index.php b/en/about/reports/2011/index.php index 144687024..9418b7565 100644 --- a/en/about/reports/2011/index.php +++ b/en/about/reports/2011/index.php @@ -1,321 +1,30 @@ 'January', 2 => 'February', 3 => 'March', - 4 => 'April', 5 => 'May', 6 => 'June', - 7 => 'July', 8 => 'August', 9 => 'September', - 10 => 'October', 11 => 'November', 12 => 'December' -); +$year = 2011; +$source_csv = 'mageia-financial-report-2011.csv'; +$page_kw = 'mageia, financial report, 2011, revenues, expenses'; -$data = file('mageia-financial-report-2011.csv'); -$parsed = array(); -foreach ($data as $l) { - if (trim($l) == ',,,,,,') - continue; +$js_options_hAxis = '{title: "2011"}'; +$js_data2_values = << ' . $l[0]; - } else { - $parsed[$tag][] = $l; - } -} +$intro = <<Here is our financial report for 2011.

-foreach ($parsed as $tag => $values) { - $val2 = array(); - $tag2 = strtolower($tag); - $teststr = strlen($tag) > 12 ? substr($tag2, 0, 13) : null; - foreach ($values as $v) { - if ($tag2 == "# head" - || $teststr == "# account bal" - || $teststr == "# income stat" - || $teststr == "# balance she" - || $tag2 == '## expenses' - || $tag2 == '## revenues' - || $tag2 == '## liabilities' - || $tag2 == '## assets') { - $val2[$v[0]] = $v[1]; - } else { - $val2[] = $v; - } - } + +S; - $parsed[$tag] = $val2; -} -$flow = array(); +$last_known_account_title = sprintf('Account status on December 31st, %s', $year); -$list = array(); -$count = array(); -foreach ($parsed['# Expenses details > ## Monthly summary'] as $line) { - $list[] = $line[2]; - $count[] = $line[1]; -} -unset($list[0]); -unset($list[13]); -unset($count[0]); -unset($count[13]); +include '../template.php'; -$flow = array( - 'expenses' => $list, - 'expenses_op' => $count, - 'revenue' => null, - 'revenue_op' => null -); - -$list = array(); -$count = array(); -foreach ($parsed['# Income details > ## Donations monthly summary'] as $line) { - $list[] = $line[2]; - $count[] = $line[1]; -} -unset($list[0]); -unset($list[13]); -unset($count[0]); -unset($count[13]); - -$flow['revenue'] = $list; -$flow['revenue_op'] = $count; - - -?> - - - - Mageia 2011 Financial Report - - - - - - - - - - - - - -
- -
-
-
-

Here is our financial report for 2011.

- - - -

Last updated on .

- -
-

Account status on December 31st, 2011

- '; - foreach ($v as $k => $w) { - $s .= sprintf('%sEUR %s', $k, $w); - } - $s .= ''; - echo $s; - ?> - -
- -

Cash flow

-
-
-
-
- -

Income statement

- - - -
RevenuesExpenses
- - ## Revenues'] as $k => $v) - $s .= sprintf('', $k, $v); - - echo $s; - ?> -
%sEUR %s
-
- - ## Expenses'] as $k => $v) - $s .= sprintf('', $k, $v); - - echo $s; - ?> -
%sEUR %s
-
- -
- -

Balance sheet

- - - -
RevenuesExpenses
- - ## Assets'] as $k => $v) - $s .= sprintf('', $k, $v); - - echo $s; - ?> -
%s%s
-
- - ## Liabilities'] as $k => $v) - $s .= sprintf('', $k, $v); - - echo $s; - ?> -
%s%s
-
-
- -

Expenses

- - ## Monthly summary']; - echo ''; - foreach ($v as $line) { - echo sprintf('', - $_months[$line[0]], $line[1], $line[2]); - } - echo '
%s%sEUR %s
'; - ?> - -

Details

- - - ## More details']; - foreach ($v as $line) { - echo sprintf('', - $line[0], $line[1], - $line[2], $line[3], - $line[4], - $line[5]); - } - ?> -
%s%s%s%s%sEUR %s
-
-

Income, donations

- ## Donations monthly summary']; - echo ''; - foreach ($v as $line) { - echo sprintf(' - - - - - ', - $_months[$line[0]], $line[1], $line[2], - $line[3], - $line[4], - $line[5], $line[6]); - } - echo '
%s%sEUR %sEUR %sEUR %sEUR %sEUR %s
'; - ?> - -
-

Feel free to contact us regarding this report.

-
-
-
-
- - diff --git a/en/about/reports/2011/mageia-financial-report-2011.csv b/en/about/reports/2011/mageia-financial-report-2011.csv index 94cc93a01..9b83b3961 100644 --- a/en/about/reports/2011/mageia-financial-report-2011.csv +++ b/en/about/reports/2011/mageia-financial-report-2011.csv @@ -9,7 +9,7 @@ "currency","EUR",,,,, "url","http://www.mageia.org/en/about/reports/",,,,, "licence","ODbL-1.0","This financial report data is made available under the Open Database License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual contents of the database are licensed under the Database Contents License: http://opendatacommons.org/licenses/dbcl/1.0/",,,, -"last updated",01/03/12,,,,, +"last updated",2012/05/11,,,,, "comment","This is a first attempt to provide open and direct access to Mageia financial data. We will try to improve on it, feel free to suggest improvements in format, detail, presentation.",,,,, ,,,,,, "",,,,,, @@ -27,14 +27,13 @@ "Total of revenues","11154,02",,,,, ,,,,,, "## Expenses",,,,,, -"FOSDEM purchases","1932,14",,,,, -"Solutions Linux purchases","159,25",,,,, "Hardware (servers)","5500,45",,,,, -"Shipments","126,98",,,,, -"FOSDEM transporation & accomodation","166,5",,,,, -"Administrative fees",44,,,,, +"Events (FOSDEM, Solutions Linux)","2091,39",,,,, "Trademark registration",280,,,,, +"Transporation & accomodation","166,5",,,,, +"Shipments","126,98",,,,, "Assoc. Membership",100,,,,, +"Administrative fees",44,,,,, "Total of expenses","8327,25",,,,, ,,,,,, "Net Income","2826,77",,,,, diff --git a/en/about/reports/2012/index.php b/en/about/reports/2012/index.php new file mode 100644 index 000000000..799cbd770 --- /dev/null +++ b/en/about/reports/2012/index.php @@ -0,0 +1,29 @@ +Here is our current financial report for 2012.

+ +
    +
  • Get the raw report data + (CSV document, licensed under ODbL 1.0). + The rest of this page is built from this data.
  • +
+S; + +$last_known_account_title = sprintf('Account status on December 31st, %s', $year); +$last_known_account_title = sprintf('Last known account status'); + +include '../template.php'; + diff --git a/en/about/reports/2012/mageia-financial-report-2012.csv b/en/about/reports/2012/mageia-financial-report-2012.csv new file mode 100644 index 000000000..ca6679fe8 --- /dev/null +++ b/en/about/reports/2012/mageia-financial-report-2012.csv @@ -0,0 +1,85 @@ +"# Head",,,,,, +"title","Mageia.org financial report for year 2012",,,,, +"org","mageia.org",,,,, +"owner","mageia.org",,,,, +"manager","mageia.org treasurer",,,,, +"contact","See http://www.mageia.org/en/about/reports/",,,,, +"type","financial report",,,,, +"year",2012,,,,, +"currency","EUR",,,,, +"url","http://www.mageia.org/en/about/reports/",,,,, +"licence","ODbL-1.0","This financial report data is made available under the Open Database License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual contents of the database are licensed under the Database Contents License: http://opendatacommons.org/licenses/dbcl/1.0/",,,, +"last updated",2012/04/02,,,,, +"comment","This is a first attempt to provide open and direct access to Mageia financial data. We will try to improve on it, feel free to suggest improvements in format, detail, presentation.",,,,, +,,,,,, +"",,,,,, +"# Account balance",,,,,, +"total","8166,37",,,,, +"main account","413,13",,,,, +"paypal","653,24",,,,, +"saving account",7100,,,,, +,,,,,, +"# Income Statement",,,,,, +,,,,,, +"## Revenues",,,,,, +"Donations","0",,,,, +"Bank interests","0",,,,, +"Total of revenues","0",,,,, +,,,,,, +"## Expenses",,,,,, +"Total of expenses","0",,,,, +,,,,,, +"Net Income","0",,,,, +,,,,,, +,,,,,, +"# Balance Sheet (incomplete)",,,,,, +,,,,,, +"## Liabilities",,,,,, +"Donations","0",,,,, +,,,,,, +"## Assets",,,,,, +"Hardware, servers","TBD",,,,, +"Promotional materials","TBD",,,,, +"Cash","0",,,,, +,,,,,, +,,,,,, +"# Income details",,,,,, +"## Donations monthly summary",,,,,, +"month","count","total amount","check","transfer","paypal","cash" +1,0,0,0,0,0,0 +2,0,0,0,0,0,0 +3,0,0,0,0,0,0 +4,0,0,0,0,0,0 +5,0,0,0,0,0,0 +6,0,0,0,0,0,0 +7,0,0,0,0,0,0 +8,0,0,0,0,0,0 +9,0,0,0,0,0,0 +10,0,0,0,0,0,0 +11,0,0,0,0,0,0 +12,0,0,0,0,0,0 +,,,,,, +,,,,,, +"# Expenses details",,,,,, +"## Monthly summary",,,,,, +"month","count","total amount",,,, +1,0,0,0,, +2,0,0,0,, +3,0,0,0,, +4,0,0,0,, +5,0,0,0,, +6,0,0,0,, +7,0,0,0,, +8,0,0,0,, +9,0,0,0,, +10,0,0,0,,, +11,0,0,0,,, +12,0,0,0,,, +"total",,,,,, +,,,,,, +"## More details",,,,,, +"date","invoice date","reference","category","description","amount", + +,,,,,, +,,,,,, +"# That's all folks!",,,,,, diff --git a/en/about/reports/index.php b/en/about/reports/index.php index 58de0a20c..49c30df91 100644 --- a/en/about/reports/index.php +++ b/en/about/reports/index.php @@ -9,11 +9,10 @@ - + - +

Activity Reports

-
diff --git a/en/about/reports/template.php b/en/about/reports/template.php new file mode 100644 index 000000000..dc5e90bb2 --- /dev/null +++ b/en/about/reports/template.php @@ -0,0 +1,373 @@ + 'January', 2 => 'February', 3 => 'March', + 4 => 'April', 5 => 'May', 6 => 'June', + 7 => 'July', 8 => 'August', 9 => 'September', + 10 => 'October', 11 => 'November', 12 => 'December' +); + +$data = file($source_csv); +$parsed = array(); +foreach ($data as $l) { + if (trim($l) == ',,,,,,') + continue; + + $l = str_getcsv(str_replace(array(',,,', ",\n"), '', $l)); + if (substr($l[0], 0, 2) == '# ') { + $tag = $l[0]; + $parent = $tag; + } elseif (substr($l[0], 0, 2) == '##') { + $tag = $parent . ' > ' . $l[0]; + } else { + $parsed[$tag][] = $l; + } +} + +foreach ($parsed as $tag => $values) { + $val2 = array(); + $tag2 = strtolower($tag); + $teststr = strlen($tag) > 12 ? substr($tag2, 0, 13) : null; + foreach ($values as $v) { + if ($tag2 == "# head" + || $teststr == "# account bal" + || $teststr == "# income stat" + || $teststr == "# balance she" + || $tag2 == '## expenses' + || $tag2 == '## revenues' + || $tag2 == '## liabilities' + || $tag2 == '## assets') { + $val2[$v[0]] = $v[1]; + } else { + $val2[] = $v; + } + } + + $parsed[$tag] = $val2; +} +$flow = array(); + +$list = array(); +$count = array(); +foreach ($parsed['# Expenses details > ## Monthly summary'] as $line) { + $list[] = $line[2]; + $count[] = $line[1]; +} +unset($list[0]); +unset($list[13]); +unset($count[0]); +unset($count[13]); + +$flow = array( + 'expenses' => $list, + 'expenses_op' => $count, + 'revenue' => null, + 'revenue_op' => null +); + +$list = array(); +$count = array(); +foreach ($parsed['# Income details > ## Donations monthly summary'] as $line) { + $list[] = $line[2]; + $count[] = $line[1]; +} +unset($list[0]); +unset($list[13]); +unset($count[0]); +unset($count[13]); + +$flow['revenue'] = $list; +$flow['revenue_op'] = $count; + + +?> + + + + Mageia.org <?php echo $year; ?> Financial Report + + + + + + + + + + + + +

Activity Reports » Financial Report

+
+
+
+
+ + +

Last updated on .

+

All amounts are in EURO.

+
+

+ '; + foreach ($v as $k => $w) { + $s .= sprintf('%s%s', + $k, number_format(str_replace(',', '.', $w), 2, '.', ',')); + } + $s .= ''; + echo $s; + ?> + +
+ +

Cash flow

+
+
+
+
+ +

Income statement

+ + + + + + + + + + + + + + + + + +
RevenuesExpenses
+ + ## Revenues'] as $k => $v) { + if (in_array($k, array('Total of revenues', 'Net Loss'))) + continue; + + $s .= sprintf('', + $k, number_format(str_replace(',', '.', $v), 2, '.', ',')); + } + echo $s; + ?> +
%s%s
+
+ + ## Expenses'] as $k => $v) { + if (in_array($k, array('Total of expenses', 'Net Income'))) + continue; + + $s .= sprintf('', + $k, number_format(str_replace(',', '.', $v), 2, '.', ',')); + } + echo $s; + ?> +
%s%s
+
Total of revenues ## Revenues']['Total of revenues']), 2, '.', ','); ?>Total of expenses ## Expenses']['Total of expenses']), 2, '.', ','); ?>
Net Income ## Expenses']['Net Income']), 2, '.', ','); ?>
+ +
+ +

Balance sheet

+ + + + + + +
AssetsLiabilities
+ + ## Assets'] as $k => $v) { + $v = str_replace(',', '.', $v); + $v = is_numeric($v) ? number_format($v, 2, '.', ',') : $v; + $s .= sprintf('', $k, $v); + } + echo $s; + ?> +
%s%s
+
+ + ## Liabilities'] as $k => $v) { + $v = str_replace(',', '.', $v); + $v = is_numeric($v) ? number_format($v, 2, '.', ',') : $v; + $s .= sprintf('', $k, $v); + } + echo $s; + ?> +
%s%s
+
Total AssetsTotal Liabilities
+
+ +

Expenses

+ + ## Monthly summary']; + echo ''; + array_shift($v); + foreach ($v as $line) { + if ($line[0] == 'total') + continue; + + echo sprintf('', + $_months[$line[0]], $line[1], + number_format(str_replace(',', '.', $line[2]), 2, '.', ',')); + } + echo '
%s%s%s
'; + ?> + +

Details

+ + + ## More details']; + $line = array_shift($v); + echo sprintf('', + $line[0], $line[1], + $line[2], $line[3], + $line[4], + $line[5]); + + foreach ($v as $line) { + if (count($line) < 2) + continue; + echo sprintf('', + $line[0], $line[1], + $line[2], $line[3], + $line[4], + number_format(str_replace(',', '.', $line[5]), 2, '.', ',')); + } + ?> + +
%s%s%s%s%s%s
%s%s%s%s%s%s
+
+

Income, donations

+ ## Donations monthly summary']; + echo ''; + $line = array_shift($v); + echo sprintf(' + + ', + $line[0], $line[1], $line[2], + $line[3], + $line[4], + $line[5], $line[6]); + + foreach ($v as $line) { + echo sprintf(' + + + + + ', + $_months[$line[0]], $line[1], + number_format(str_replace(',', '.', $line[2]), 2, '.', ','), + number_format(str_replace(',', '.', $line[3]), 2, '.', ','), + number_format(str_replace(',', '.', $line[4]), 2, '.', ','), + number_format(str_replace(',', '.', $line[5]), 2, '.', ','), + number_format(str_replace(',', '.', $line[6]), 2, '.', ',')); + } + echo '
%s%s%s%s%s%s%s
%s%s%s%s%s%s%s
'; + ?> + +
+

Feel free to contact us regarding this report.

+
+
+
+
+ + -- cgit v1.2.1