This commit was generated by cvs2svn to compensate for changes in r11022,
[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 { 'Cancel all of this customer\'s packages'; }
7
8 sub option_fields {
9   ( 
10     'reasonnum' => { 'label'        => 'Reason',
11                      'type'         => 'select-reason',
12                      'reason_class' => 'C',
13                    },
14   );
15 }
16
17 sub default_weight { 20; }
18
19 sub do_action {
20   my( $self, $cust_object ) = @_;
21
22   my $cust_main = $self->cust_main($cust_object);
23
24   my $error = $cust_main->cancel( 'reason' => $self->option('reasonnum') );
25   die $error if $error;
26   
27   '';
28 }
29
30 1;