Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/cust bill event"

From Freeside
Jump to: navigation, search
(import from POD)
(import from POD)
 
(2 intermediate revisions by the same user not shown)
Line 20: Line 20:
 
An FS::cust_bill_event object represents an complete invoice event. FS::cust_bill_event inherits from FS::Record. The following fields are currently supported:
 
An FS::cust_bill_event object represents an complete invoice event. FS::cust_bill_event inherits from FS::Record. The following fields are currently supported:
  
; eventnum - primary key; invnum - invoice (see [[Freeside:1.9:Documentation:Developer/FS/cust bill|FS::cust_bill]]); eventpart - event definition (see [[Freeside:1.9:Documentation:Developer/FS/part bill event|FS::part_bill_event]]); _date - specified as a UNIX timestamp; see [[Freeside:1.9:Documentation:Developer/perlfunc#time|"time" in perlfunc|perlfunc#time|"time" in perlfunc]]. Also see [[Freeside:1.9:Documentation:Developer/Time/Local|Time::Local]] and [[Freeside:1.9:Documentation:Developer/Date/Parse|Date::Parse]] for conversion functions.; status - event status: '''done''' or '''failed'''; statustext - additional status detail (i.e. error message)
+
; eventnum
 +
:Primary key
 +
; invnum
 +
:Invoice (see [[Freeside:1.9:Documentation:Developer/FS/cust bill|FS::cust_bill]])
 +
; eventpart
 +
:Event definition (see [[Freeside:1.9:Documentation:Developer/FS/part bill event|FS::part_bill_event]])
 +
; _date
 +
:Specified as a UNIX timestamp; see [[perlfunc#time|"time" in perlfunc]]. Also see [[Freeside:1.9:Documentation:Developer/Time/Local|Time::Local]] and [[Freeside:1.9:Documentation:Developer/Date/Parse|Date::Parse]] for conversion functions.
 +
; status
 +
:Event status: '''done''' or '''failed'''
 +
; statustext
 +
:Additional status detail (i.e. error message)
 +
 
 
==METHODS==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF
Line 42: Line 54:
 
; retryable
 
; retryable
 
:Changes the statustext of this event to '''retriable''', rendering it retriable (should retry be called).
 
:Changes the statustext of this event to '''retriable''', rendering it retriable (should retry be called).
 +
; search_sql HASHREF
 +
:Class method which returns an SQL WHERE fragment to search for parameters specified in HASHREF. Valid parameters are
 +
:; agentnum:; beginning
 +
::An epoch date setting a lower bound for _date values
 +
:; ending
 +
::An epoch date setting a upper bound for _date values
 +
:; failed
 +
::Limits the search to failed events if true
 +
:; payby
 +
::Requires that the search be JOIN'd to part_bill_event # Bug?
 +
:; invnum:; currentuser
 +
::Specifies the user for agent virtualization
  
 
==SUBROUTINES==
 
==SUBROUTINES==

Latest revision as of 19:04, 18 February 2008

NAME

FS::cust_bill_event - Object methods for cust_bill_event records

SYNOPSIS

 use FS::cust_bill_event;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::cust_bill_event object represents an complete invoice event. FS::cust_bill_event inherits from FS::Record. The following fields are currently supported:

eventnum
Primary key
invnum
Invoice (see FS::cust_bill)
eventpart
Event definition (see FS::part_bill_event)
_date
Specified as a UNIX timestamp; see "time" in perlfunc. Also see Time::Local and Date::Parse for conversion functions.
status
Event status: done or failed
statustext
Additional status detail (i.e. error message)

METHODS

new HASHREF
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.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
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.
check
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.
part_bill_event
Returns the invoice event definition (see FS::part_bill_event) for this completed invoice event.
cust_bill
Returns the invoice (see FS::cust_bill) for this completed invoice event.
retry
Changes the status of this event from done to failed, allowing it to be retried.
retryable
Changes the statustext of this event to retriable, rendering it retriable (should retry be called).
search_sql HASHREF
Class method which returns an SQL WHERE fragment to search for parameters specified in HASHREF. Valid parameters are
agentnum
; beginning
An epoch date setting a lower bound for _date values
ending
An epoch date setting a upper bound for _date values
failed
Limits the search to failed events if true
payby
Requires that the search be JOIN'd to part_bill_event # Bug?
invnum
; currentuser
Specifies the user for agent virtualization

SUBROUTINES

reprint; reemail; refax

BUGS

Far too early in the morning.

SEE ALSO

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