diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-16 20:27:00 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-16 20:27:00 +0000 |
commit | 096e94906cfcb29ae4913d26d136fa834b8e905b (patch) | |
tree | 607bc5342d5620b09b12ecf1ca6bc167816ed9c5 | |
parent | 89f4b7b98b6138c2ec10dc42e22d3bd27aab33bf (diff) | |
download | mgatres-096e94906cfcb29ae4913d26d136fa834b8e905b.tar mgatres-096e94906cfcb29ae4913d26d136fa834b8e905b.tar.gz mgatres-096e94906cfcb29ae4913d26d136fa834b8e905b.tar.bz2 mgatres-096e94906cfcb29ae4913d26d136fa834b8e905b.tar.xz mgatres-096e94906cfcb29ae4913d26d136fa834b8e905b.zip |
Add per account transactions pages
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8286 5b7c3c08-40e5-403b-9995-ace06908e4af
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mktreasurer | 11 | ||||
-rw-r--r-- | tmpl/index.html | 6 | ||||
-rw-r--r-- | tmpl/tra_row.html | 2 | ||||
-rw-r--r-- | tmpl/transactions_by_ac.html | 30 |
5 files changed, 45 insertions, 5 deletions
@@ -1,5 +1,6 @@ - sort transactions by category - add yearly and monthly transactions pages +- add per account transactions pages Version 0.2 diff --git a/mktreasurer b/mktreasurer index 961e269..9cf8c7a 100755 --- a/mktreasurer +++ b/mktreasurer @@ -230,6 +230,17 @@ sub output_pages { "p_$pa") if $transactions->{by_pa}->{$pa}; } + foreach my $ac (keys %{$transactions->{by_ac}}) { + my $vars = { + config => $config, + ac => $ac, + account => $transactions->{by_ac}->{$ac}->{account}, + donations => $donations, + transactions => $transactions, + }; + process_template($template, 'transactions_by_ac', $vars, "a_$ac"); + } + my $vars = { config => $config, donations => $donations, diff --git a/tmpl/index.html b/tmpl/index.html index 511c4b3..0c8153f 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -30,13 +30,11 @@ <ul> <li>Global balances: [% transactions.balance %] Euros</li> - [%- FOR ac IN transactions.by_ac.values -%] - <li>[% ac.account %] : [% ac.balance %] Euros</li> + [%- FOR ac IN transactions.by_ac.keys -%] + <li><a href="a_[% ac %].html">[% transactions.by_ac.$ac.account %]</a>: [% transactions.by_ac.$ac.balance %] Euros</li> [%- END -%] </ul> - More details coming soon. - <h3>Expenses and revenues by category</h3> <ul> diff --git a/tmpl/tra_row.html b/tmpl/tra_row.html index afe3f56..ae3caf7 100644 --- a/tmpl/tra_row.html +++ b/tmpl/tra_row.html @@ -1,7 +1,7 @@ <tr> <td>[% date.format(tra.date) %]</td> <td>[% tra.amount %]</td> - <td>[% tra.account %]</td> + <td><a href="a_[% tra.ac %].html">[% tra.account %]</a></td> <td>[% tra.who %]</td> [% IF tra.trt %] <td>Internal transfert</td> diff --git a/tmpl/transactions_by_ac.html b/tmpl/transactions_by_ac.html new file mode 100644 index 0000000..9d2e170 --- /dev/null +++ b/tmpl/transactions_by_ac.html @@ -0,0 +1,30 @@ +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>[% config.sitename %]: Transactions for [% account %]</title> + </head> + <body> + <h1>Mageia.Org transactions for [% account %]</h1> + <h3>Summary</h3> + <ul> + <li> + <b>Balance</b>: [% transactions.by_ac.$ac.balance %] Euros + </li> + </ul> + <h3>Details</h3> + <table border="1"> + <tr> + <th>Date</th> + <th>Amount</th> + <th>Account</th> + <th>Who</th> + <th>Notes</th> + <th>Category</th> + </tr> + [%- USE date(format='%Y/%m/%d') -%] + [% FOR tra IN transactions.by_ac.$ac.transactions.sort('date').reverse %] + [%- INCLUDE tra_row.html %] + [%- END -%] + </table> + </body> +</html> |