aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rwxr-xr-xmktreasurer2
-rw-r--r--tmpl/index.json1
3 files changed, 5 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5c6136f..3e294ad 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- add total donations to index.json
+
Version 0.6
- Fix Makefile to install tmp/*.json files
diff --git a/mktreasurer b/mktreasurer
index fda59ad..000bef1 100755
--- a/mktreasurer
+++ b/mktreasurer
@@ -83,6 +83,7 @@ sub donations_infos {
by_year => {},
by_pa => {},
total_30 => 0,
+ total => 0,
sorted_pa_by_total => [],
);
foreach my $don (@{$res{donations}}) {
@@ -100,6 +101,7 @@ sub donations_infos {
if (time - $don->{date} < '2592000') { # last 30 days
$res{total_30} += $don->{amount};
}
+ $res{total} += $don->{amount};
}
foreach my $d ((values %{$res{by_month}}), (values %{$res{by_year}}),
(values %{$res{by_pa}})) {
diff --git a/tmpl/index.json b/tmpl/index.json
index b6102d7..686732b 100644
--- a/tmpl/index.json
+++ b/tmpl/index.json
@@ -4,6 +4,7 @@
SET out = {};
SET out.balance = transactions.balance.bstr;
SET out.donations_30days = donations.total_30.bstr;
+ SET out.donations_total = donations.total.bstr;
SET out.last_donations = [];
SET out.last_update = date.format(last_update, format => '%Y/%m/%d %H:%M:%S');
SET i=0;