X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FAction.pm;h=fb63ffe2e6f06c800f52f7f6149db3cabf123f27;hb=d856e90f730f72d173c2eedde4c81bba20c583b8;hp=c41af2851a457fea2f990a76be1dcff1d9e3c441;hpb=aa8d3305bddaca26d9222ebfa48af191d28f8230;p=freeside.git diff --git a/FS/FS/part_event/Action.pm b/FS/FS/part_event/Action.pm index c41af2851..fb63ffe2e 100644 --- a/FS/FS/part_event/Action.pm +++ b/FS/FS/part_event/Action.pm @@ -51,9 +51,23 @@ sub eventtable_hashref { 'cust_bill' => 1, 'cust_pkg' => 1, 'cust_pay_batch' => 1, + 'svc_acct' => 1, }; } +=item event_stage + +Action classes may define an event_stage method to indicate a preference +for being run at a non-standard stage of the billing and collection process. + +This method may currently return "collect" (the default) or "pre-bill". + +=cut + +sub event_stage { + 'collect'; +} + =item option_fields Action classes may define an option_fields method to indicate that they @@ -71,6 +85,8 @@ hashref with the following values: =item size - Size for text fields +=item validation - (optional) Validate optionvalue using the given object method, such as ut_textn, ut_email + =item options - For checkbox-multiple and select, a list reference of available option values. =item option_labels - For select, a hash reference of availble option values and labels. @@ -136,6 +152,18 @@ sub deprecated { 0; } +=item will_send_invoice + +Action classes may define a will_send_invoice method that returns true, indicating +that this action is sending out an invoice. + +=cut + +#default +sub will_send_invoice { + 0; +} + =item do_action CUSTOMER_EVENT_OBJECT Action classes must define an action method. This method is triggered if @@ -178,6 +206,21 @@ sub cust_main { } +=item cust_pkg OBJECT + +Return the package object (L) associated with the provided +object. The object must be either a service (L) or a +package. + +=cut + +sub cust_pkg { + my( $self, $object ) = @_; + $object->isa('FS::cust_pkg') ? $object : + $object->isa('FS::svc_Common') ? $object->cust_svc->cust_pkg : + undef; +} + =item option_label OPTIONNAME Returns the label for the specified option name. @@ -204,6 +247,7 @@ Returns the option fields as an (ordered) hash reference. sub option_fields_hashref { my $self = shift; tie my %hash, 'Tie::IxHash', $self->option_fields; + \%hash; } =item option_fields_listref