Freeside:4:Documentation:Developer/FS/cust event

From Freeside
Jump to: navigation, search


FS::cust_event - Object methods for cust_event records


 use FS::cust_event;

 $record = new FS::cust_event \%hash;
 $record = new FS::cust_event { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;


An FS::cust_event object represents an completed event. FS::cust_event inherits from FS::Record. The following fields are currently supported:

eventnum - primary key; eventpart - event definition (see FS::part_event); tablenum - customer, package or invoice, depending on the value of part_event.eventtable (see FS::cust_main, FS::cust_pkg, and FS::cust_bill); _date - specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.; status - event status: new, locked, done or failed. Note: done indicates the event is complete and should not be retried (statustext may still be set to an optional message), while failed indicates the event failed and should be retried.; statustext - additional status detail (i.e. error or progress message)


Creates a new completed invoice event. To add the compelted invoice event 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.
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid completed invoice event. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the event definition (see FS::part_event) for this completed event.
Returns the customer, package, invoice or batched payment (see FS::cust_main, FS::cust_pkg, FS::cust_bill or FS::cust_pay_batch) for this completed invoice event.
test_conditions [ OPTION => VALUE ... ]
Tests conditions for this event, returns true if all conditions are satisfied, false otherwise.
Runs the event action.
Changes the status of this event from done to failed, allowing it to be retried.
join_sql; search_sql_where HASHREF
Class method which returns an SQL WHERE fragment to search for parameters specified in HASHREF. Valid parameters are
; custnum:; invnum:; pkgnum:; svcnum:; failed:; beginning:; ending


reprint; reemail; refax


FS::part_event, FS::cust_bill, FS::Record, schema.html from the base documentation.