my $bill_payment_map = $CC->bill_payment_map_for_xact(undef, $c);
# Pull out those entries for overdue bills in reverse date order.
- my @fine_map = sort { $b->{bill}->billing_ts() <=> $a->{bill}->billing_ts() }
- grep { $_->{bill}->btype() == 1 && $_->{bill}->billing_ts() > $c->$due_date_method }
- @{$bill_payment_map};
+ my @fine_map = reverse grep { $_->{bill}->btype() == 1 } @{$bill_payment_map};
my $f_idx = 0;
my $current_fine_total = 0;
}
# Set the $fine to be used for $last_fine below.
$fine = $fine_map[$f_idx]->{bill} if ($fine_map[$f_idx]);
- # Calculate the current fine total using the modified bill amounts from the bill payment map.
- map { $current_fine_total += int($_->{bill}->amount() * 100) }
- grep { $_->{bill_amount} < $_->{void_amount} } @fine_map;
+ # Calculate the current fine total using the original bill amounts from the bill payment map.
+ map { $current_fine_total += int($_->{bill_amount} * 100) }
+ grep { $_->{bill_amount} > $_->{void_amount} } @fine_map;
}
my $last_fine;