From 6ea282a20e78ec622199b23e9c5ed0f4493236ef Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 12 May 2013 14:40:52 +0000 Subject: mga-treasurer: fix subcategory name git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8208 5b7c3c08-40e5-403b-9995-ace06908e4af --- mga-treasurer | 7 ++++--- 1 file 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; -- cgit v1.2.1