1 package FS::part_event::Action::cust_bill_fee_percent;
4 use base qw( FS::part_event::Action );
6 sub description { 'Late fee (percentage of invoice)'; }
8 sub eventtable_hashref {
14 'percent' => { label=>'Percent', size=>2, },
16 'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
20 sub default_weight { 10; }
23 my( $self, $cust_bill ) = @_;
25 #my $cust_main = $self->cust_main($cust_bill);
26 my $cust_main = $cust_bill->cust_main;
29 sprintf('%.2f', $cust_bill->owed * $self->option('percent') / 100 );
31 my $error = $cust_main->charge( {
33 'pkg' => $self->option('reason'),
34 'taxclass' => $self->option('taxclass'),
35 #'start_date' => $cust_main->next_bill_date, #unless its more than N months away?