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