event refactor, landing on HEAD!
[freeside.git] / FS / FS / part_event / Action / suspend.pm
1 package FS::part_event::Action::suspend;
2
3 use strict;
4 use base qw( FS::part_event::Action );
5
6 sub description {
7   'Suspend';
8 }
9
10 sub option_fields {
11   ( 
12     'reasonnum' => { 'label'        => 'Reason',
13                      'type'         => 'select-reason',
14                      'reason_class' => 'S',
15                    },
16   );
17 };
18
19 sub default_weight {
20   10;
21 }
22
23 sub do_action {
24   my( $self, $cust_object ) = @_;
25
26   my $cust_main = $self->cust_main($cust_object);
27
28   my @err = $cust_main->suspend( 'reason' => $self->option('reasonnum') );
29
30   die join(' / ', @err) if scalar(@err);
31
32   '';
33
34 }
35
36 1;