Freeside:3:Documentation:Developer/FS/cust statement

From Freeside
< Freeside:3:Documentation:Developer‎ | FS
Revision as of 13:34, 27 June 2014 by Jeremyd (talk | contribs) (Edit via perl MediaWiki framework (1.13))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::cust_statement - Object methods for cust_statement records

SYNOPSIS

 use FS::cust_statement;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::cust_statement object represents an informational statement which aggregates one or more invoices. FS::cust_statement inherits from FS::cust_bill.

The following fields are currently supported:

statementnum
primary key
custnum
customer
_date
date

METHODS

new HASHREF
Creates a new record. To add the record 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.
Pass "statementnum => 'ALL'" to create a temporary statement that includes all of the customer's open invoices. This statement can't be inserted and won't set the statementnum field on any invoices.
Pass "invnum => number" to create a temporary statement including only the specified invoice. This is functionally the same as the invoice itself, but will be rendered using the statement template and other statement-specific options.
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 record. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
cust_bill
Returns the associated invoices (cust_bill records) for this statement.
cust_bill_pkg
Returns the line items (see FS::cust_bill_pkg) for all associated invoices.
cust_bill_pkg_pkgnum PKGNUM
Returns the line items (see FS::cust_bill_pkg) for all associated invoices and specified pkgnum.
cust_bill_pay
Returns all payment applications (see FS::cust_bill_pay) for all associated invoices.
cust_credited
Returns all applied credits (see FS::cust_credit_bill) for all associated invoices.
cust_bill_pay_pkgnum PKGNUM
Returns all payment applications (see FS::cust_bill_pay) for all associated invoices with matching pkgnum.
cust_credited_pkgnum PKGNUM
Returns all applied credits (see FS::cust_credit_bill) for all associated invoices with matching pkgnum.
tax
Returns the total tax amount for all assoicated invoices.0
charged
Returns the total amount charged for all associated invoices.
owed
Returns the total amount owed for all associated invoices.

BUGS

SEE ALSO

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