From 6bfd9cc285b5967180420a86b47db5743771563f Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Wed, 19 Jun 2013 17:50:34 +0000 Subject: add total donations to index.json git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8537 5b7c3c08-40e5-403b-9995-ace06908e4af --- NEWS | 2 ++ mktreasurer | 2 ++ tmpl/index.json | 1 + 3 files changed, 5 insertions(+) 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; -- cgit v1.2.1