aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-15 22:56:29 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-15 22:56:29 +0000
commit7dd909091c252e29e1f6b65cef19019733563c52 (patch)
tree4b77bb706c539438ef38734cb6535e042724cca5
parent0443a9d4131bd15977a4bdb08eacabf13fcd105c (diff)
downloadmgatres-7dd909091c252e29e1f6b65cef19019733563c52.tar
mgatres-7dd909091c252e29e1f6b65cef19019733563c52.tar.gz
mgatres-7dd909091c252e29e1f6b65cef19019733563c52.tar.bz2
mgatres-7dd909091c252e29e1f6b65cef19019733563c52.tar.xz
mgatres-7dd909091c252e29e1f6b65cef19019733563c52.zip
Move donation_category selection outside donations_list
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8263 5b7c3c08-40e5-403b-9995-ace06908e4af
-rwxr-xr-xmktreasurer9
1 files changed, 4 insertions, 5 deletions
diff --git a/mktreasurer b/mktreasurer
index 9f89b6a..e818e3c 100755
--- a/mktreasurer
+++ b/mktreasurer
@@ -41,10 +41,9 @@ sub epoch_date {
}
sub donations_list {
- my $r = shift;
+ my ($r, $cat) = @_;
my @res;
- my $don_cat = donation_category($r);
- my @donations = grep { $_->{Ca} == $don_cat } @{$r->{Transaction}};
+ my @donations = grep { $_->{Ca} == $cat } @{$r->{Transaction}};
foreach my $don (@donations) {
my %d = (
nb => $don->{Nb},
@@ -52,7 +51,7 @@ sub donations_list {
date => epoch_date($don->{Dt}),
pa => $don->{Pa},
who => party_name($r, $don->{Pa}),
- type => subcat_name($r, $don->{Sca}, $don_cat),
+ type => subcat_name($r, $don->{Sca}, $cat),
$don->{No} ne '(null)' ? (notes => $don->{No}) : (),
);
push @res, \%d;
@@ -63,7 +62,7 @@ sub donations_list {
sub donations_infos {
my $r = shift;
my %res = (
- donations => donations_list($r),
+ donations => donations_list($r, donation_category($r)),
by_month => {},
by_year => {},
by_pa => {},