aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-12 14:40:52 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-12 14:40:52 +0000
commit6ea282a20e78ec622199b23e9c5ed0f4493236ef (patch)
tree64433cc10f0ec1e49668465cdd916155407ef48c
parent67438a91f1f65d7de5743bfdf8455c473b75e885 (diff)
downloadmgatres-6ea282a20e78ec622199b23e9c5ed0f4493236ef.tar
mgatres-6ea282a20e78ec622199b23e9c5ed0f4493236ef.tar.gz
mgatres-6ea282a20e78ec622199b23e9c5ed0f4493236ef.tar.bz2
mgatres-6ea282a20e78ec622199b23e9c5ed0f4493236ef.tar.xz
mgatres-6ea282a20e78ec622199b23e9c5ed0f4493236ef.zip
mga-treasurer: fix subcategory name
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8208 5b7c3c08-40e5-403b-9995-ace06908e4af
-rwxr-xr-xmga-treasurer7
1 files changed, 4 insertions, 3 deletions
diff --git a/mga-treasurer b/mga-treasurer
index 9cec2b5..bc06e3c 100755
--- a/mga-treasurer
+++ b/mga-treasurer
@@ -30,8 +30,9 @@ sub party_name {
}
sub subcat_name {
- my ($r, $Nb) = @_;
- (grep { $_->{Nb} == $Nb } @{$r->{Sub_category}})[0]->{Na};
+ my ($r, $Nb, $Nbc) = @_;
+ (grep { $_->{Nb} == $Nb && $_->{Nbc} == $Nbc }
+ @{$r->{Sub_category}})[0]->{Na};
}
sub epoch_date {
@@ -49,7 +50,7 @@ sub donations_list {
amount => $don->{Am},
date => epoch_date($don->{Dt}),
who => party_name($r, $don->{Pa}),
- type => subcat_name($r, $don->{Sca}),
+ type => subcat_name($r, $don->{Sca}, $don_cat),
$don->{No} ne '(null)' ? (notes => $don->{No}) : (),
);
push @res, \%d;