diff options
-rw-r--r-- | en/about/reports/2011/index2.php | 67 | ||||
-rw-r--r-- | en/about/reports/2011/mageia-accounts-2011.csv | 7 | ||||
-rw-r--r-- | en/about/reports/2011/mageia-forecast-2011.csv | 16 | ||||
-rw-r--r-- | en/about/reports/2011/mageia-report-2011.csv | 26 | ||||
-rw-r--r-- | lib/fi-report.php | 249 |
5 files changed, 365 insertions, 0 deletions
diff --git a/en/about/reports/2011/index2.php b/en/about/reports/2011/index2.php new file mode 100644 index 000000000..67f2a6b67 --- /dev/null +++ b/en/about/reports/2011/index2.php @@ -0,0 +1,67 @@ +<!DOCTYPE html> +<html dir="ltr" lang="en"> +<head> + <meta charset="utf-8"> + <title>Mageia Financial Report (2011)</title> + <meta name="description" content="Mageia is new community-based Linux distribution."> + <meta name="keywords" content="mageia, financial report, 2011"> + <meta name="author" content="Mageia"> + <link rel="stylesheet" type="text/css" href="/g/style/all.css"> + <?php include '../../../../analytics.php'; ?> +</head> +<body> + <?php include '../../../../langs.php'; ?> + + <div id="doc" class="yui-t7"> + <div id="hd" role="banner"><h1><a id="logo" href="/en/"><span>Mageia</span></a> <span class="lsep">|</span> <span class="subh">Financial Report (2011)</span></h1></div> + <div id="bd" role="main"> + <div class="yui-g"> + <div class="para values"> + <p style="color: #fff; background: red; padding: 0.3em 0.4em 0.4em 0.6em; font-size: 85%;"> + Being redesigned – Take with a grain of salt for now.</p> + <?php + include G_APP_ROOT . '/lib/fi-report.php'; + + $mfr = Mageia_Financial_Report::build(array( + 'accounts' => 'mageia-accounts-2011.csv', + 'report' => 'mageia-report-2011.csv', + 'forecast' => 'mageia-forecast-2011.csv' + )); + + $hReport = $mfr->html_report(); + $hForecast = $mfr->html_forecast(); + $hAccounts = $mfr->html_accounts(); + $hSummary = $mfr->html_summary(); + ?> + <h2>Summary</h2> + <?php echo $hSummary; ?> + <hr> + + <h2>Bank accounts situation</h2> + <?php echo $hAccounts; ?> + <hr> + + <h2>Financial Report</h2> + <?php echo $hReport; ?> + <hr> + + <h2>Forecast for 2011</h2> + <?php echo $hForecast; ?> + <hr> + + <h2>Miscellaneous</h2> + <ul> + <li>You can <a href="#" hreflang="en">download this report</a> as a PDF file.</li> + <li>You can help Mageia.Org by <a href="/en/donate/" hreflang="en">doing a donation</a>.</li> + <li>You can see the <a href="/en/thank-you" hreflang="en">"thank you" page</a>.</li> + </ul> + <hr> + <h2>Contact</h2> + <p>Financial report published by Damien Lallement (Mageia Treasurer on the 2011 Fiscal Year).<br> + You can contact him by sending an email to <em>treasurer[at]mageia[dot]org</em>.</p> + </div> + </div> + </div> + </div> +</body> +</html>
\ No newline at end of file diff --git a/en/about/reports/2011/mageia-accounts-2011.csv b/en/about/reports/2011/mageia-accounts-2011.csv new file mode 100644 index 000000000..952e29cd6 --- /dev/null +++ b/en/about/reports/2011/mageia-accounts-2011.csv @@ -0,0 +1,7 @@ +head;Bank accounts +head;Current accounts positions +head;http://www.mageia.org/ +head;Account;Amount +;Paypal (not-for-profit organisation account);443.34 +;Main account (with checkbook, no credit card);1401.29 +;Savings account (between 2% and 4% interest rate);5503.06
\ No newline at end of file diff --git a/en/about/reports/2011/mageia-forecast-2011.csv b/en/about/reports/2011/mageia-forecast-2011.csv new file mode 100644 index 000000000..224496c27 --- /dev/null +++ b/en/about/reports/2011/mageia-forecast-2011.csv @@ -0,0 +1,16 @@ +head;2011 Forecast; +head; +head;http://www.mageia.org/ +head;Description of planned expediture;Unit price;Quantity;Recurrence;Total price;Status +;Goodies;4500;1;1;;Pending +;April;100;1;1;;Pending +;Gandi (hosting: +1536MB of RAM);2.39;6;12;;Done (Wed Mar 30) +;Dedibox (build ISO);14.99;1;12;;Pending +;Internet domains;15;7;1;;Pending +;Fiona (backup server);1500;1;1;;Pending +;2 new nodes for BS;2500;2;1;;Pending +;Event box;1500;1;1;;Pending +;Event travel;1000;1;2;;Pending +;HW for spare;3000;1;1;;Pending +;Brand registration;250;1;1;;Pending +;Reserve fund;4000;1;1;;Pending
\ No newline at end of file diff --git a/en/about/reports/2011/mageia-report-2011.csv b/en/about/reports/2011/mageia-report-2011.csv new file mode 100644 index 000000000..9bd8230a8 --- /dev/null +++ b/en/about/reports/2011/mageia-report-2011.csv @@ -0,0 +1,26 @@ +head;Financial report +head;Lists transactions that happened on Mageia.Org accounts +head;http://www.mageia.org/ +head;Date;Transaction description;Outgoing;Income +cat;Donations and sales +;;Donations via Paypal/transfer/check;;1920.97; +;;Sale of T-shirts;;1050; +cat;Fees and Administrative costs +;;Administrative costs for the birth of Mageia.Org (JO);44; +;;April (annual fee);100; +;;INPI brand registration for 10 years (rda);250; +;;Annual interest of our savings account;;3.06 +cat;Goodies and accessories +;;Posters and flyers for Solutions Linux (rda);159.25; +;;Stickers and T-shirts for FOSDEM;1932.14; +;;Money box (dams);17.93; +cat;Shipments +;;40 TS to wobo for Chemnitzer Linuxtage;54.65; +;;3 TS to donors in France (dams);12.30; +;;2 TS to saipo for Dijon event in France (dams);25; +cat;Hardware and hosting +;;RAM on Gandi.net hosting (for blog/planet/www);250; +;;SSL for domains on Gandi.net;215.28; +;;HDD for servers (boklm);242.70; +cat;Travel and events +;;Hotel + train for wobo (FOSDEM 2011);166.50;
\ No newline at end of file diff --git a/lib/fi-report.php b/lib/fi-report.php new file mode 100644 index 000000000..d1f5950a2 --- /dev/null +++ b/lib/fi-report.php @@ -0,0 +1,249 @@ +<?php +/** +*/ + +class Mageia_Financial_Report +{ + function __construct() + { + + } + + /** + */ + function build($files) + { + $i = new self; + $i->report_file = $files['report']; + $i->forecast_file = $files['forecast']; + $i->accounts_file = $files['accounts']; + + $i->CUR = '<span style="color: #777; font-size: 80%%;">EUR</span>'; + + return $i; + } + + /** + */ + function html_summary() + { + $account2010 = 7523.96; + $this->hAccount2010 = number_format($account2010, 2); + $this->hAccountLeft = number_format($account2010 + $this->balance, 2); + + return <<<S + <table class="fr-table"> + <tr> + <td>Outstanding amount of <a href="../2010/">2010</a></td> + <td class="money">{$this->CUR} {$this->hAccount2010}</td> + </tr> + <tr> + <td colspan="3">Collected</td> + <td class="money">{$this->CUR} {$this->hInTotal}</td> + </tr> + <tr> + <td colspan="2">Spent</td> + <td class="money">{$this->CUR} {$this->hOutTotal}</td> + </tr> + <tr> + <td>Balance</td> + <td class="money">{$this->CUR} {$this->hBalance}</td> + </tr> + <tr> + <td>Remaining amount today</td> + <td class="money">{$this->CUR} {$this->hAccountLeft}</td> + </tr> + </table> +S; + } + + /** + */ + function html_report() + { + $f = file($this->report_file); + $hFileMTime = $this->html_source_file($this->report_file); + + $inTotal = 0; + $outTotal = 0; + $hLines = ''; + + $line_tmpl = <<<S + <tr> + <td>%s</td> + <td>%s</td> + <td class="money">%s</td> + <td class="money">%s</td> + </tr> +S; + $cat_tmpl = '<tr><td colspan="4"><em>%s</em></td></tr>'; + + foreach ($f as $l) + { + $l = str_getcsv($l, ';'); + if ('cat' === trim($l[0])) { + $hLines .= sprintf($cat_tmpl, $l[1]); + } + elseif ('' === trim($l[0])) { + $hLines .= sprintf($line_tmpl, + $l[1], $l[2], + $l[3] != '' ? $this->CUR . ' ' . number_format($l[3], 2) : '', + $l[4] != '' ? $this->CUR . ' ' . number_format($l[4], 2) : ''); + + $inTotal += $l[4]; + $outTotal += $l[3]; + } + } + $this->balance = $balance = $inTotal - $outTotal; + $this->hInTotal = $hInTotal = number_format($inTotal, 2); + $this->hOutTotal = $hOutTotal = number_format($outTotal, 2); + $this->hBalance = $hBalance = number_format($balance, 2); + + $s = <<<S + <table class="fr-table"><thead> + <tr><th>Date</th> + <th>Transaction description</th> + <th>Outgoing</th> + <th>Incoming</th> + </tr> + </thead><tbody> + {$hLines} + <tr> + <td colspan="2">Total</td> + <td class="money">{$this->CUR} {$hOutTotal}</td> + <td class="money">{$this->CUR} {$hInTotal}</td> + </tr> + <tr> + <td colspan="2">Balance</td> + <td class="money" colspan="2" style="text-align: center;">{$this->CUR} {$hBalance}</td> + </tr> + </tbody></table> + {$hFileMTime} +S; + return $s; + } + + /** + */ + function html_forecast() + { + $f = file($this->forecast_file); + $hFileMTime = $this->html_source_file($this->forecast_file); + + $total = 0; + $doneTotal = 0; + $hLines = ''; + $CUR = '<span style="color: #777; font-size: 80%%;">EUR</span>'; + + $line_tmpl = <<<S + <tr> + <td>%s</td> + <td class="money">{$CUR} %s</td> + <td class="money">%d</td> + <td class="money">%d</td> + <td class="money">{$CUR} %s</td> + <td>%s</td> + </tr> +S; + + foreach ($f as $l) + { + $l = str_getcsv($l, ';'); + if ('' === trim($l[0])) { + $subtotal = $l[2] * $l[3] * $l[4]; + $hLines .= sprintf($line_tmpl, + $l[1], number_format($l[2], 2), $l[3], $l[4], number_format($subtotal, 2), $l[6]); + + $total += $subtotal; + if (strtolower($l[6]) != 'pending') { + $doneTotal += $subtotal; + } + } + } + + $hTotal = number_format($total, 2); + $hDoneTotal = number_format($doneTotal, 2); + $hProgress = round($doneTotal / $total * 100, 2); + + $s = <<<S + <table class="fr-table"><thead> + <tr><th>Description of planned expenditure</th> + <th>Unit Price</th> + <th>Quantity</th> + <th>Recurrence</th> + <th>Total Price</th> + <th>Status</th></tr> + </thead><tbody> + {$hLines} + <tr> + <td colspan="4">Total forecasted</td> + <td class="money">{$CUR} {$hTotal}</td> + <td></td> + </tr> + <tr> + <td colspan="4">Total done</td> + <td class="money">{$CUR} {$hDoneTotal}</td> + <td class="money">{$hProgress}%</td> + </tr> + </tbody></table> + {$hFileMTime} +S; + return $s; + } + + /** + */ + function html_accounts() + { + $f = file($this->accounts_file); + $hFileMTime = $this->html_source_file($this->accounts_file); + + $total = 0; + $doneTotal = 0; + $hLines = ''; + $CUR = '<span style="color: #777; font-size: 80%%;">EUR</span>'; + + $line_tmpl = <<<S + <tr> + <td>%s</td> + <td class="money">{$CUR} %s</td> + </tr> +S; + + foreach ($f as $l) + { + $l = str_getcsv($l, ';'); + if ('' === trim($l[0])) { + $hLines .= sprintf($line_tmpl, + $l[1], number_format($l[2], 2)); + + $total += $l[2]; + } + } + + $hTotal = number_format($total, 2); + + $s = <<<S + <table class="fr-table"><thead> + <tr><th>Account</th> + <th>Amount</th> + </thead><tbody> + {$hLines} + <tr> + <td>Total</td> + <td class="money">{$CUR} {$hTotal}</td> + </tr> + </tbody></table> + {$hFileMTime} +S; + return $s; + } + + /** + */ + function html_source_file($file) + { + return sprintf('<p style="font-size: 80%%; color: #777;">Source: <a href="%s">%s</a> (last updated on %s).</p>', + $file, $file, date('c', filemtime($file))); + } +} |