add tax class selection back for late charges w/1.9 events, RT#5665
[freeside.git] / FS / FS / part_event / Action / fee.pm
1 package FS::part_event::Action::fee;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description { 'Late fee (flat)'; }
7
8 sub option_fields {
9   ( 
10     'charge'   => { label=>'Amount', type=>'money', }, # size=>7, },
11     'reason'   => 'Reason',
12     'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
13   );
14 }
15
16 sub default_weight { 10; }
17
18 sub do_action {
19   my( $self, $cust_object ) = @_;
20
21   my $cust_main = $self->cust_main($cust_object);
22
23   my $error = $cust_main->charge( {
24     'amount'   => $self->option('charge'),
25     'pkg'      => $self->option('reason'),
26     'taxclass' => $self->option('taxclass')
27     #'start_date' => $cust_main->next_bill_date, #unless its more than N months away?
28   } );
29
30   die $error if $error;
31
32   '';
33 }
34
35 1;