% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::part_event - Object methods for part_event records
use FS::part_event;
$record = new FS::part_event \%hash;
$record = new FS::part_event { 'column' => 'value' };
$error = $record->insert( { 'option' => 'value' } );
$error = $record->insert( \%options );
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
$error = $record->do_event( $direct_object );
An FS::part_event object represents an event definition - a billing, collection or other callback which is triggered when certain customer, invoice, package or other conditions are met. FS::part_event inherits from FS::Record. The following fields are currently supported:
Creates a new invoice event definition. To add the invoice event definition to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
If a list or hash reference of options is supplied, part_export_option records are created (see FS::part_event_option).
Delete this record from the database.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
If a list or hash reference of options is supplied, part_event_option records are created or modified (see FS::part_event_option).
Checks all fields to make sure this is a valid invoice event definition. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Reblesses the object into the FS::part_event::Action::ACTION class, where ACTION is the object's action field.
Returns the conditions associated with this event, as FS::part_event_condition objects (see FS::part_event_condition)
Creates a new customer event (see FS::cust_event) for the provided object.
The only option allowed is 'time', to set the "current" time for the event.
Returns the associated agent for this event, if any, as an FS::agent object.
Returns the alternate invoice template name, if any, or false if there is no alternate template for this event.
Returns all objects (of type FS::eventtable, for this object's eventtable) eligible for processing under this event, as of right now. The FS::cust_event object used to test event conditions will be included in each object as the 'cust_event' pseudo-field.
This is not used in normal event processing (which is done on a per-customer basis to control timing of pre- and post-billing events) but can be useful when configuring events.
Identify all objects eligible for this event and create FS::cust_event records for each of them, as of the present time, with status "initial". When combined with conditions that prevent an event from running more than once (at all or within some period), this will exclude any objects that met the conditions before the event was created.
If an FS::part_event object needs to be initialized, it should be created in a disabled state to avoid running the event prematurely for any existing objects. initialize will enable it once all the cust_event records have been created.
This may take some time, so it should be run from the job queue.
Returns a hash reference of labels for eventtable values, i.e. 'cust_main'=>'Customer'
Returns a hash reference of full SQL primary key names for eventtable values, i.e. 'cust_main'=>'cust_main.custnum'
Returns a hash reference of full SQL primary key names for eventtable values, i.e. 'cust_main'=>'custnum'
Returns a list of eventtable values (default ordering; suited for display).
Returns a list of eventtable values (run order).
Returns a hash reference of SQL expressions to join each eventtable to a table with a 'custnum' field.
Returns a hash reference of SQL expressions for the 'custnum' field when eventtables_cust_join is in effect. The default is "$eventtable.custnum".
Returns a hash reference of labels for check_freq values, i.e. '1d'=>'daily'
Return information about the available actions. If an eventtable is specified, only return information about actions available for that eventtable.
Information is returned as key-value pairs. Keys are event names. Values are hashrefs with the following keys:
To add an eventtable, you must:
See FS::part_event::Action for more information.
Returns a list of just the action names
Returns a list of action names that send invoices
Job queue wrapper for "initialize". EVENTPART identifies the FS::part_event object to initialize.
FS::part_event_option, FS::part_event_condition, FS::cust_main, FS::cust_pkg, FS::svc_acct, FS::cust_bill, FS::cust_event, FS::Record, schema.html from the base documentation.
Hey! The above document had some coding errors, which are explained below:
=cut found outside a pod block. Skipping to next block.
You forgot a '=back' before '=head1'
'=item' outside of any '=over'