aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rwxr-xr-xmktreasurer11
-rw-r--r--tmpl/index.html6
-rw-r--r--tmpl/tra_row.html2
-rw-r--r--tmpl/transactions_by_ac.html30
5 files changed, 45 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 7793468..26a5524 100644
--- a/NEWS
+++ b/NEWS
@@ -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>