- $row->{this} = $form->{$category}{$key}{this} * $account{$category}{ml};
-
- # only add assets
- if ($row->{charttype} eq 'A') {
- $form->{total}{$category}{this} += $row->{this};
- }
-
- if ($last_period) {
- $row->{last} = $form->{$category}{$key}{last} * $account{$category}{ml};
- $form->{total}{$category}{last} += $row->{last};
+ for my $period (qw(this last)) {
+ next if ($period eq 'last' && !$last_period);
+ # only add assets
+ $row->{$period} *= $ml;
+ $form->{total}{$category}{$period} += $row->{$period}; # if ($row->{charttype} eq 'A') { # why??