diff options
author | Jason (Jayce^) Hall <jayce@lug-nut.com> | 2015-01-08 15:37:52 -0700 |
---|---|---|
committer | Jason (Jayce^) Hall <jayce@lug-nut.com> | 2015-01-08 15:37:52 -0700 |
commit | 82fca8a493a6490e385b40ebea690b29bf35bdbd (patch) | |
tree | 203ade911833c802ccf27ca43363bcebda2585cc /FS/FS/part_event/Action | |
parent | 52a223d87f3bc7068dbda03b86b10add80ec273b (diff) |
Similar to cust_bill_suspend, create the ability to CANCEL the packages
on an invoice. Create an invoice event that can trigger this.
Diffstat (limited to 'FS/FS/part_event/Action')
-rw-r--r-- | FS/FS/part_event/Action/cust_bill_cancel.pm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/FS/FS/part_event/Action/cust_bill_cancel.pm b/FS/FS/part_event/Action/cust_bill_cancel.pm new file mode 100644 index 0000000..70cce46 --- /dev/null +++ b/FS/FS/part_event/Action/cust_bill_cancel.pm @@ -0,0 +1,35 @@ +package FS::part_event::Action::cust_bill_cancel; + +use strict; +use base qw( FS::part_event::Action ); + +sub description { 'Cancel packages on this invoice'; } + +sub eventtable_hashref { + { 'cust_bill' => 1 }; +} + +sub option_fields { + ( + 'reasonnum' => { 'label' => 'Reason', + 'type' => 'select-reason', + 'reason_class' => 'C', + }, + ); +} + +sub default_weight { 10; } + +sub do_action { + my( $self, $cust_bill ) = @_; + + my @err = $cust_bill->cancel( + 'reason' => $self->option('reasonnum'), + ); + + die join(' / ', @err) if scalar(@err); + + return ''; +} + +1; |