diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-17 23:07:27 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-17 23:07:27 +0000 |
commit | 5d9ad62cb3940986954c4ba48645fc1506f0ea82 (patch) | |
tree | 7e7afe426f3c74c576cbdbe486a6affe8cc57647 | |
parent | 3183040340349e7f963457555122fee8fa50b5fc (diff) | |
download | mgatres-5d9ad62cb3940986954c4ba48645fc1506f0ea82.tar mgatres-5d9ad62cb3940986954c4ba48645fc1506f0ea82.tar.gz mgatres-5d9ad62cb3940986954c4ba48645fc1506f0ea82.tar.bz2 mgatres-5d9ad62cb3940986954c4ba48645fc1506f0ea82.tar.xz mgatres-5d9ad62cb3940986954c4ba48645fc1506f0ea82.zip |
mktreasurer: don't add duplicate entries in months array
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8322 5b7c3c08-40e5-403b-9995-ace06908e4af
-rwxr-xr-x | mktreasurer | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mktreasurer b/mktreasurer index eafe58e..8501435 100755 --- a/mktreasurer +++ b/mktreasurer @@ -92,7 +92,8 @@ sub donations_infos { $res{by_month}->{$month}->{year} = $year; $res{by_month}->{$month}->{month} = $dt->month; push @{$res{by_year}->{$year}->{donations}}, $don; - push @{$res{by_year}->{$year}->{months}}, $month; + push @{$res{by_year}->{$year}->{months}}, $month + unless grep { $_ eq $month } @{$res{by_year}->{$year}->{months}}; push @{$res{by_pa}->{$don->{pa}}->{donations}}, $don; if (time - $don->{date} < '2592000') { # last 30 days $res{total_30} += $don->{amount}; @@ -128,7 +129,8 @@ sub transactions_infos { $res{by_month}->{$month}->{month} = $dt->month; $res{by_ac}->{$tra->{ac}}->{account} = $tra->{account}; push @{$res{by_year}->{$year}->{transactions}}, $tra; - push @{$res{by_year}->{$year}->{months}}, $month; + push @{$res{by_year}->{$year}->{months}}, $month + unless grep { $_ eq $month } @{$res{by_year}->{$year}->{months}}; push @{$res{by_pa}->{$tra->{pa}}->{transactions}}, $tra; push @{$res{by_ac}->{$tra->{ac}}->{transactions}}, $tra; if ($tra->{ca}) { |