From a07404806a3dad6ca2758229b3c4e79978e2f660 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Mon, 20 May 2013 16:42:49 +0000 Subject: Add categories graphs git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8342 5b7c3c08-40e5-403b-9995-ace06908e4af --- tmpl/index.html | 80 ++++++++++++++++++++++++++++++++++++++++-- tmpl/transactions_by_year.html | 80 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 156 insertions(+), 4 deletions(-) (limited to 'tmpl') diff --git a/tmpl/index.html b/tmpl/index.html index d6862bc..f04135a 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -38,9 +38,85 @@

Expenses and revenues by category

+ [%- + SET ca_expenses = []; + SET ca_expenses_names = []; + SET ca_revenues = []; + SET ca_revenues_names = []; + + FOREACH ca IN transactions.by_ca.keys.sort; + IF transactions.by_ca.$ca.expenses != 0; + ca_expenses.push(ca); + ca_expenses_names.push(transactions.by_ca.$ca.c_name); + END; + IF transactions.by_ca.$ca.revenues != 0; + ca_revenues.push(ca); + ca_revenues_names.push(transactions.by_ca.$ca.c_name); + END; + END; + -%] + +

Expenses

+ [% IF ca_expenses.size > 1 %] + + + + [% END %] + + +

Revenues

+ [% IF ca_revenues.size > 1 %] + + + + [% END %] diff --git a/tmpl/transactions_by_year.html b/tmpl/transactions_by_year.html index 08e9c60..b363c72 100644 --- a/tmpl/transactions_by_year.html +++ b/tmpl/transactions_by_year.html @@ -22,11 +22,87 @@

By category

+ + [%- + SET ca_expenses = []; + SET ca_expenses_names = []; + SET ca_revenues = []; + SET ca_revenues_names = []; + + IF transactions.by_year.$year.ca_revenues; + FOREACH ca IN transactions.by_year.$year.ca_revenues.keys; + ca_revenues.push(ca); + ca_revenues_names.push(transactions.by_ca.$ca.c_name); + END; + END; + IF transactions.by_year.$year.ca_expenses; + FOREACH ca IN transactions.by_year.$year.ca_expenses.keys; + ca_expenses.push(ca); + ca_expenses_names.push(transactions.by_ca.$ca.c_name); + END; + END; + -%] +

Expenses

+ [% IF ca_expenses.size > 1 %] + + + + [% END %] + + +

Revenues

+ [% IF ca_revenues.size > 1 %] + + + + [% END %] +

Monthly reports

-- cgit v1.2.1