referral credits overhaul, use billing events, agents can self-configure, limit to...
[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 { 'Suspend'; }
7
8 sub option_fields {
9   ( 
10     'reasonnum' => { 'label'        => 'Reason',
11                      'type'         => 'select-reason',
12                      'reason_class' => 'S',
13                    },
14   );
15 }
16
17 sub default_weight { 10; }
18
19 sub do_action {
20   my( $self, $cust_object ) = @_;
21
22   my $cust_main = $self->cust_main($cust_object);
23
24   my @err = $cust_main->suspend( 'reason' => $self->option('reasonnum') );
25
26   die join(' / ', @err) if scalar(@err);
27
28   '';
29
30 }
31
32 1;