suspend event option to skip packages with a start_date, RT#83847
[freeside.git] / FS / FS / part_event / Action / pkg_suspend.pm
1 package FS::part_event::Action::pkg_suspend;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description { 'Suspend this package'; }
7
8 sub eventtable_hashref {
9   { 'cust_pkg' => 1,
10     'svc_acct' => 1, };
11 }
12
13 sub option_fields {
14   ( 
15     'reasonnum' => { 'label'        => 'Reason',
16                      'type'         => 'select-reason',
17                      'reason_class' => 'S',
18                    },
19   );
20 }
21
22 sub default_weight { 20; }
23
24 sub do_action {
25   my( $self, $object, $cust_event ) = @_;
26   my $cust_pkg = $self->cust_pkg($object);
27
28   my $error = $cust_pkg->suspend( 'reason' => $self->option('reasonnum') );
29   die $error if $error;
30   
31   '';
32 }
33
34 1;