diff options
author | mark <mark> | 2010-11-22 01:30:16 +0000 |
---|---|---|
committer | mark <mark> | 2010-11-22 01:30:16 +0000 |
commit | 5d129680ad627d1d3fccb4c2104984de7fbc384e (patch) | |
tree | 7fa231134aad512214894a99162422c32ce9340d | |
parent | 67d1c64001b99cc8ae578b15e4546cc66ddfd65d (diff) |
pkg_cancel event action, RT#10141
-rw-r--r-- | FS/FS/part_event/Action/cancel.pm | 2 | ||||
-rw-r--r-- | FS/FS/part_event/Action/pkg_cancel.pm | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/FS/FS/part_event/Action/cancel.pm b/FS/FS/part_event/Action/cancel.pm index b9d6d2996..b93682b54 100644 --- a/FS/FS/part_event/Action/cancel.pm +++ b/FS/FS/part_event/Action/cancel.pm @@ -3,7 +3,7 @@ package FS::part_event::Action::cancel; use strict; use base qw( FS::part_event::Action ); -sub description { 'Cancel'; } +sub description { 'Cancel all of this customer\'s packages'; } sub option_fields { ( diff --git a/FS/FS/part_event/Action/pkg_cancel.pm b/FS/FS/part_event/Action/pkg_cancel.pm new file mode 100644 index 000000000..2bfd35cad --- /dev/null +++ b/FS/FS/part_event/Action/pkg_cancel.pm @@ -0,0 +1,32 @@ +package FS::part_event::Action::pkg_cancel; + +use strict; +use base qw( FS::part_event::Action ); + +sub description { 'Cancel this package'; } + +sub eventtable_hashref { + { 'cust_pkg' => 1 }; +} + +sub option_fields { + ( + 'reasonnum' => { 'label' => 'Reason', + 'type' => 'select-reason', + 'reason_class' => 'C', + }, + ); +} + +sub default_weight { 20; } + +sub do_action { + my( $self, $cust_pkg, $cust_event ) = @_; + + my $error = $cust_pkg->cancel( 'reason' => $self->option('reasonnum') ); + die $error if $error; + + ''; +} + +1; |