1 package FS::part_event::Action::fee;
4 use base qw( FS::part_event::Action );
6 sub description { 'Late fee (flat)'; }
8 sub event_stage { 'pre-bill'; }
12 'charge' => { label=>'Amount', type=>'money', }, # size=>7, },
13 'reason' => 'Reason (invoice line item)',
14 'classnum' => { label=>'Package class' => type=>'select-pkg_class', },
15 'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
16 'setuptax' => { label=>'Late fee is tax exempt',
17 type=>'checkbox', value=>'Y' },
18 'nextbill' => { label=>'Hold late fee until next invoice',
19 type=>'checkbox', value=>'Y' },
23 sub default_weight { 10; }
26 #my( $self, $cust_object ) = @_;
28 $self->option('charge');
32 my( $self, $cust_object ) = @_;
34 my $cust_main = $self->cust_main($cust_object);
36 my $conf = new FS::Conf;
39 'amount' => $self->_calc_fee($cust_object),
40 'pkg' => $self->option('reason'),
41 'taxclass' => $self->option('taxclass'),
42 'classnum' => ( $self->option('classnum')
43 || scalar($conf->config('finance_pkgclass')) ),
44 'setuptax' => $self->option('setuptax'),
47 #unless its more than N months away?
48 $charge{'start_date'} = $cust_main->next_bill_date
49 if $self->option('nextbill');
51 my $error = $cust_main->charge( \%charge );