summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Action/cancel.pm2
-rw-r--r--FS/FS/part_event/Action/pkg_cancel.pm32
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;