1 package FS::part_event::Action::cust_bill_fee_percent;
4 use base qw( FS::part_event::Action::fee );
7 sub description { 'Late fee (percentage of invoice)'; }
9 sub eventtable_hashref {
16 my $t = tie my %option_fields, 'Tie::IxHash', $class->SUPER::option_fields();
17 $t->Shift; #assumes charge is first
18 $t->Unshift( 'percent' => { label=>'Percent', size=>2, } );
24 my( $self, $cust_bill ) = @_;
25 sprintf('%.2f', $cust_bill->owed * $self->option('percent') / 100 );