Freeside:4:Documentation:Developer/FS/sales

From Freeside
Jump to: navigation, search

NAME

FS::sales - Object methods for sales records

SYNOPSIS

 use FS::sales;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::sales object represents a sales person. FS::sales inherits from FS::Record. The following fields are currently supported:

salesnum
primary key
salesperson
Name
agentnum
Agent (see FS::agent)
disabled
Disabled flag, empty or `Y'
sales_custnum
Sales person master customer (see FS::cust_main)

METHODS

new HASHREF
Creates a new sales person. To add the sales person 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 sales person. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
sales_cust_main
Returns the FS::cust_main object (see FS::cust_main), if any, for this sales person.
cust_bill_pkg START END OPTIONS
Returns the package line items (see FS::cust_bill_pkg) for which this sales person could receive commission.
START and END are an optional date range to limit the results.
OPTIONS may contain: - cust_main_sales: if this is a true value, sales of packages that have no package sales person will be included if this is their customer sales person. - classnum: limit to this package classnum. - paid: limit to sales that have no unpaid balance.

BUGS

SEE ALSO

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

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 47:
Unterminated L<...> sequence