This commit was generated by cvs2svn to compensate for changes in r11022,
[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 }
11
12 sub option_fields {
13   ( 
14     'reasonnum' => { 'label'        => 'Reason',
15                      'type'         => 'select-reason',
16                      'reason_class' => 'S',
17                    },
18   );
19 }
20
21 sub default_weight { 20; }
22
23 sub do_action {
24   my( $self, $cust_pkg, $cust_event ) = @_;
25
26   my $error = $cust_pkg->suspend( 'reason' => $self->option('reasonnum') );
27   die $error if $error;
28   
29   '';
30 }
31
32 1;