Difference between revisions of "Freeside:3:Documentation:Developer/FS/cust main invoice"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
(No difference)

Latest revision as of 20:04, 27 June 2012

NAME

FS::cust_main_invoice - Object methods for cust_main_invoice records

SYNOPSIS

 use FS::cust_main_invoice;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

 $email_address = $record->address;

DESCRIPTION

An FS::cust_main_invoice object represents an invoice destination. FS::cust_main_invoice inherits from FS::Record. The following fields are currently supported:

destnum - primary key; custnum - customer (see FS::cust_main); dest - Invoice destination: If numeric, a svcnum (see FS::svc_acct), if string, a literal email address, `POST' to enable mailing (the default if no cust_main_invoice records exist), or `FAX' to enable faxing via a HylaFAX server.

METHODS

new HASHREF
Creates a new invoice destination. To add the invoice destination 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 invoice destination. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
checkdest
Checks the dest field only.
  1. If it finds that the account ends in the #same domain configured as the domain configuration file, it will change the #invoice destination from an email address to a service number (see #FS::svc_acct).
address
Returns the literal email address for this record (or `POST' or `FAX').
cust_main
Returns the parent customer object (see FS::cust_main).

BUGS

SEE ALSO

FS::Record, FS::cust_main