X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Freason_type.pm;h=a727ccd0a9262346d098825b2695368ed0bf2ce6;hb=c82e10e2a7af8039962b3f2bd8df4050977c279c;hp=482ea34e8e216131b914f1066a6b83e2e4dbb2c1;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/FS/FS/reason_type.pm b/FS/FS/reason_type.pm index 482ea34e8..a727ccd0a 100644 --- a/FS/FS/reason_type.pm +++ b/FS/FS/reason_type.pm @@ -6,16 +6,34 @@ use FS::Record qw( qsearch qsearchs ); @ISA = qw(FS::Record); -our %class_name = ( +tie our %class_name, Tie::IxHash, ( 'C' => 'cancel', 'R' => 'credit', 'S' => 'suspend', + 'F' => 'refund', + 'X' => 'void credit', + 'I' => 'void invoice', + 'P' => 'void payment', ); our %class_purpose = ( 'C' => 'explain why a customer package was cancelled', 'R' => 'explain why a customer was credited', 'S' => 'explain why a customer package was suspended', + 'F' => 'explain why a customer was refunded', + 'X' => 'explain why a credit was voided', + 'I' => 'explain why an invoice was voided', + 'P' => 'explain why a payment was voided', +); + +our %class_add_access_right = ( + 'C' => 'Add on-the-fly cancel reason', + 'R' => 'Add on-the-fly credit reason', + 'S' => 'Add on-the-fly suspend reason', + 'F' => 'Add on-the-fly refund reason', + 'X' => 'Add on-the-fly void reason', + 'I' => 'Add on-the-fly void reason', + 'P' => 'Add on-the-fly void reason', ); =head1 NAME @@ -46,7 +64,7 @@ inherits from FS::Record. The following fields are currently supported: =item typenum - primary key -=item class - currently 'C', 'R', or 'S' for cancel, credit, or suspend +=item class - one of the keys of %class_name =item type - name of the type of reason @@ -131,12 +149,7 @@ sub enabled_reasons { } ); } -# _populate_initial_data -# # Used by FS::Setup to initialize a new database. -# -# - sub _populate_initial_data { # class method my ($self, %opts) = @_; @@ -162,21 +175,14 @@ sub _populate_initial_data { # class method # my $error = $object->insert(); # die "error inserting $self into database: $error\n" # if $error; -# # or clause for 1.7.x - $conf->set($_, $object->typenum) - or die "failed setting config"; + $conf->set($_, $object->typenum); } ''; } -# _upgrade_data -# # Used by FS::Upgrade to migrate to a new database. -# -# - sub _upgrade_data { # class method my ($self, %opts) = @_;