X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FAction%2Ffee.pm;h=163b4fa24369fb42b7a079557e7a127f6fadba7c;hb=947c1f964f1304242f8a6ffabacccf040f1d505e;hp=3cf50fbca14205e195f0c1448e769f0779ca4480;hpb=58f99accce35aa76abe9ff852f6c6ee84e8ce712;p=freeside.git diff --git a/FS/FS/part_event/Action/fee.pm b/FS/FS/part_event/Action/fee.pm index 3cf50fbca..163b4fa24 100644 --- a/FS/FS/part_event/Action/fee.pm +++ b/FS/FS/part_event/Action/fee.pm @@ -5,10 +5,17 @@ use base qw( FS::part_event::Action ); sub description { 'Late fee (flat)'; } +sub event_stage { 'pre-bill'; } + sub option_fields { ( - 'charge' => { label=>'Amount', type=>'money', }, # size=>7, }, - 'reason' => 'Reason', + 'charge' => { label=>'Amount', type=>'money', }, # size=>7, }, + 'reason' => 'Reason', + 'taxclass' => { label=>'Tax class', type=>'select-taxclass', }, + 'nextbill' => { label=>'Hold late fee until next invoice', + type=>'checkbox', value=>'Y' }, + 'setuptax' => { label=>'Late fee is tax exempt', + type=>'checkbox', value=>'Y' }, ); } @@ -19,7 +26,20 @@ sub do_action { my $cust_main = $self->cust_main($cust_object); - my $error = $cust_main->charge( $self->option('charge'), $self->option('reason') ); + my $conf = new FS::Conf; + + my %charge = ( + 'amount' => $self->option('charge'), + 'pkg' => $self->option('reason'), + 'taxclass' => $self->option('taxclass'), + 'classnum' => $conf->config('finance_pkgclass'), + 'setuptax' => $self->option('setuptax'), + ); + + $charge{'start_date'} = $cust_main->next_bill_date #unless its more than N months away? + if $self->option('nextbill'); + + my $error = $cust_main->charge( \%charge ); die $error if $error;