diff options
Diffstat (limited to 'FS/FS/part_event/Action/writeoff.pm')
-rw-r--r-- | FS/FS/part_event/Action/writeoff.pm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/FS/FS/part_event/Action/writeoff.pm b/FS/FS/part_event/Action/writeoff.pm new file mode 100644 index 0000000..8529d29 --- /dev/null +++ b/FS/FS/part_event/Action/writeoff.pm @@ -0,0 +1,33 @@ +package FS::part_event::Action::writeoff; + +use strict; +use base qw( FS::part_event::Action ); + +sub description { 'Write off bad debt with a credit entry.'; } + +sub option_fields { + ( + #'charge' => { label=>'Amount', type=>'money', }, # size=>7, }, + 'reasonnum' => { 'label' => 'Reason', + 'type' => 'select-reason', + 'reason_class' => 'R', + }, + ); +} + +sub default_weight { 65; } + +sub do_action { + my( $self, $cust_object ) = @_; + + my $cust_main = $self->cust_main($cust_object); + + my $reasonnum = $self->option('reasonnum'); + + my $error = $cust_main->credit( $cust_main->balance, \$reasonnum ); + die $error if $error; + + ''; +} + +1; |