aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-16 20:26:35 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-16 20:26:35 +0000
commite165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f (patch)
treede9497cafce3a472093de59d597189fd21064b3a
parentfe891f817a2095b96223052ad4e01431627961d2 (diff)
downloadmgatres-e165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f.tar
mgatres-e165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f.tar.gz
mgatres-e165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f.tar.bz2
mgatres-e165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f.tar.xz
mgatres-e165fa3a7e0ae3ef1c1d2ec67447e0ed3a070a7f.zip
mktreasurer: create transactions pages if templates available
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8277 5b7c3c08-40e5-403b-9995-ace06908e4af
-rwxr-xr-xmktreasurer25
1 files changed, 19 insertions, 6 deletions
diff --git a/mktreasurer b/mktreasurer
index 29cd269..fa41ae0 100755
--- a/mktreasurer
+++ b/mktreasurer
@@ -150,27 +150,36 @@ sub output_pages {
);
my $last_update = (stat $config->{grisbi_file})[9];
- foreach my $month (keys %{$donations->{by_month}}) {
+ foreach my $month (keys %{ { %{$donations->{by_month}},
+ %{$transactions->{by_month}} } }) {
my $vars = {
config => $config,
month => $month,
donations => $donations,
transactions => $transactions,
};
- process_template($template, 'donations_by_month', $vars, "donations_m_$month");
+ process_template($template, 'donations_by_month', $vars,
+ "donations_m_$month") if $donations->{by_month}->{$month};
+ process_template($template, 'transactions_by_month', $vars,
+ "m_$month") if $transactions->{by_month}->{$month};
}
- foreach my $year (keys %{$donations->{by_year}}) {
+ foreach my $year (keys %{ { %{$donations->{by_year}},
+ %{$transactions->{by_year}} } }) {
my $vars = {
config => $config,
year => $year,
donations => $donations,
transactions => $transactions,
};
- process_template($template, 'donations_by_year', $vars, "donations_y_$year");
+ process_template($template, 'donations_by_year', $vars,
+ "donations_y_$year") if $donations->{by_year}->{$year};
+ process_template($template, 'transactions_by_year', $vars,
+ "y_$year") if $transactions->{by_year}->{$year};
}
- foreach my $pa (keys %{$donations->{by_pa}}) {
+ foreach my $pa (keys %{ { %{$donations->{by_pa}},
+ %{$transactions->{by_pa}} } }) {
my $vars = {
config => $config,
pa => $pa,
@@ -178,7 +187,10 @@ sub output_pages {
donations => $donations,
transactions => $transactions,
};
- process_template($template, 'donations_by_pa', $vars, "donations_p_$pa");
+ process_template($template, 'donations_by_pa', $vars,
+ "donations_p_$pa") if $donations->{by_pa}->{$pa};
+ process_template($template, 'transactions_by_pa', $vars,
+ "p_$pa") if $transactions->{by_pa}->{$pa};
}
my $vars = {
@@ -188,6 +200,7 @@ sub output_pages {
last_update => $last_update,
};
process_template($template, 'donations', $vars, 'donations');
+ process_template($template, 'transactions', $vars, 'transactions');
process_template($template, 'index', $vars, 'index');
}