delete fees, RT#81713
[freeside.git] / FS / FS / part_event / Action.pm
index 9dcde5a..c0c70b1 100644 (file)
@@ -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
@@ -178,6 +192,21 @@ sub cust_main {
 
 }
 
+=item cust_pkg OBJECT
+
+Return the package object (L<FS::cust_pkg>) associated with the provided 
+object.  The object must be either a service (L<FS::svc_Common>) 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.
@@ -216,7 +245,6 @@ Returns just the option field names as a list reference.
 sub option_fields_listref {
   my $self = shift;
   my $hashref = $self->option_fields_hashref;
-  warn $hashref;
   [ keys %$hashref ];
 }