From 77e6cc578ac0aa185269254d77bade2039450dd2 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Sun, 16 Oct 2011 22:46:52 +0000 Subject: fi report experiment --- lib/fi-report.php | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/fi-report.php b/lib/fi-report.php index d1f5950a2..c53c1752a 100644 --- a/lib/fi-report.php +++ b/lib/fi-report.php @@ -30,28 +30,41 @@ class Mageia_Financial_Report $account2010 = 7523.96; $this->hAccount2010 = number_format($account2010, 2); $this->hAccountLeft = number_format($account2010 + $this->balance, 2); - + + $balanceSign = $this->balance >= 0 ? 'plus' : 'minus'; + return << + + + + + - - + + + + - - + + - - + + + + - - + + + - - + + +
At the end of 2010 we had{$this->CUR} {$this->hAccount2010}.
Outstanding amount of 2010{$this->CUR} {$this->hAccount2010}Since then, we received{$this->CUR} {$this->hInTotal},and spent{$this->CUR} {$this->hOutTotal} + (see detailed report).
Collected{$this->CUR} {$this->hInTotal}Our balance so far is of{$this->CUR} {$this->hBalance},
Spent{$this->CUR} {$this->hOutTotal}and we still have{$this->CUR} {$this->hAccountLeft}:{$this->CUR} {$this->accounts[0][1]}in our {$this->accounts[0][0]}
Balance{$this->CUR} {$this->hBalance}{$this->CUR} {$this->accounts[1][1]}in our {$this->accounts[1][0]}
Remaining amount today{$this->CUR} {$this->hAccountLeft}{$this->CUR} {$this->accounts[2][1]}in our {$this->accounts[2][0]}
S; @@ -202,7 +215,6 @@ S; $doneTotal = 0; $hLines = ''; $CUR = 'EUR'; - $line_tmpl = << %s @@ -210,10 +222,15 @@ S; S; + $this->accounts = array(); foreach ($f as $l) { $l = str_getcsv($l, ';'); if ('' === trim($l[0])) { + $this->accounts[] = array( + str_replace(array('(', ')'), array('(', ')'), $l[1]), + number_format($l[2], 2) + ); $hLines .= sprintf($line_tmpl, $l[1], number_format($l[2], 2)); @@ -221,7 +238,7 @@ S; } } - $hTotal = number_format($total, 2); + $hTotal = number_format($total, 2); $s = << @@ -234,6 +251,8 @@ S; {$CUR} {$hTotal} +S; + $s =<<