diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-16 20:27:03 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-16 20:27:03 +0000 |
commit | f1647e2f33ab09e70c19f9265b40f09656986b41 (patch) | |
tree | 1a7e3c7b17be82352a1d97b5cfcce114bc74fe09 | |
parent | 096e94906cfcb29ae4913d26d136fa834b8e905b (diff) | |
download | mgatres-f1647e2f33ab09e70c19f9265b40f09656986b41.tar mgatres-f1647e2f33ab09e70c19f9265b40f09656986b41.tar.gz mgatres-f1647e2f33ab09e70c19f9265b40f09656986b41.tar.bz2 mgatres-f1647e2f33ab09e70c19f9265b40f09656986b41.tar.xz mgatres-f1647e2f33ab09e70c19f9265b40f09656986b41.zip |
Add per category transactions pages
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8287 5b7c3c08-40e5-403b-9995-ace06908e4af
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mktreasurer | 11 | ||||
-rw-r--r-- | tmpl/index.html | 2 | ||||
-rw-r--r-- | tmpl/tra_row.html | 4 | ||||
-rw-r--r-- | tmpl/transactions_by_ca.html | 33 | ||||
-rw-r--r-- | tmpl/transactions_by_month.html | 2 | ||||
-rw-r--r-- | tmpl/transactions_by_year.html | 2 |
7 files changed, 51 insertions, 4 deletions
@@ -1,6 +1,7 @@ - sort transactions by category - add yearly and monthly transactions pages - add per account transactions pages +- add per category transactions pages Version 0.2 diff --git a/mktreasurer b/mktreasurer index 9cf8c7a..dd8c08e 100755 --- a/mktreasurer +++ b/mktreasurer @@ -241,6 +241,17 @@ sub output_pages { process_template($template, 'transactions_by_ac', $vars, "a_$ac"); } + foreach my $ca (keys %{$transactions->{by_ca}}) { + my $vars = { + config => $config, + ca => $ca, + c_name => $transactions->{by_ca}->{$ca}->{c_name}, + donations => $donations, + transactions => $transactions, + }; + process_template($template, 'transactions_by_ca', $vars, "c_$ca"); + } + my $vars = { config => $config, donations => $donations, diff --git a/tmpl/index.html b/tmpl/index.html index 0c8153f..357f1ce 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -39,7 +39,7 @@ <ul> [%- FOR ca IN transactions.by_ca.keys.sort %] - <li><b>[% transactions.by_ca.$ca.c_name %]</b>: [% transactions.by_ca.$ca.balance %] Euros</li> + <li><b><a href="c_[% ca %].html">[% transactions.by_ca.$ca.c_name %]</a></b>: [% transactions.by_ca.$ca.balance %] Euros</li> [%- END -%] </ul> diff --git a/tmpl/tra_row.html b/tmpl/tra_row.html index ae3caf7..61b6f46 100644 --- a/tmpl/tra_row.html +++ b/tmpl/tra_row.html @@ -8,7 +8,9 @@ [% ELSE %] <td>[% tra.notes %]</td> [% END %] - <td>[% tra.c_name %] + <td>[% IF tra.ca %] + <a href="c_[% tra.ca %].html">[% tra.c_name %]</a> + [% END %] [% IF tra.sc_name %] : [% tra.sc_name %] [% END %] diff --git a/tmpl/transactions_by_ca.html b/tmpl/transactions_by_ca.html new file mode 100644 index 0000000..ff48ecd --- /dev/null +++ b/tmpl/transactions_by_ca.html @@ -0,0 +1,33 @@ +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>[% config.sitename %]: Transactions for [% c_name %]</title> + </head> + <body> + <h1>Mageia.Org transactions for category [% c_name %]</h1> + <h3>Summary</h3> + <ul> + [% IF transactions.by_ca.$ca.revenues != 0 %] + <li><b>Revenues</b>: [% transactions.by_ca.$ca.revenues %] Euros</li> + [% END %] + [% IF transactions.by_ca.$ca.expenses != 0 %] + <li><b>Expenses</b>: [% transactions.by_ca.$ca.expenses %] Euros</li> + [% END %] + </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_ca.$ca.transactions.sort('date').reverse %] + [%- INCLUDE tra_row.html %] + [%- END -%] + </table> + </body> +</html> diff --git a/tmpl/transactions_by_month.html b/tmpl/transactions_by_month.html index 063094e..f0835bc 100644 --- a/tmpl/transactions_by_month.html +++ b/tmpl/transactions_by_month.html @@ -23,7 +23,7 @@ <h3>By category</h3> <ul> [% FOR ca IN transactions.by_month.$month.ca_balance.keys %] - <li><b>[% transactions.by_ca.$ca.c_name %]</b>: [% transactions.by_month.$month.ca_balance.$ca %] Euros</b></li> + <li><b><a href="c_[% ca %].html">[% transactions.by_ca.$ca.c_name %]</a></b>: [% transactions.by_month.$month.ca_balance.$ca %] Euros</b></li> [%- END -%] </ul> <h3>Details</h3> diff --git a/tmpl/transactions_by_year.html b/tmpl/transactions_by_year.html index 5ee0095..2397d1d 100644 --- a/tmpl/transactions_by_year.html +++ b/tmpl/transactions_by_year.html @@ -23,7 +23,7 @@ <h3>By category</h3> <ul> [% FOR ca IN transactions.by_year.$year.ca_balance.keys %] - <li><b>[% transactions.by_ca.$ca.c_name %]</b>: [% transactions.by_year.$year.ca_balance.$ca %] Euros</b></li> + <li><b><a href="c_[% ca %].html">[% transactions.by_ca.$ca.c_name %]</a></b>: [% transactions.by_year.$year.ca_balance.$ca %] Euros</b></li> [%- END -%] </ul> <h3>Monthly reports</h3> |