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