% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::sales - Object methods for sales records
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;
An FS::sales object represents a sales person. FS::sales inherits from FS::Record. The following fields are currently supported:
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.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
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 sales person. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the FS::cust_main object (see FS::cust_main), if any, for this sales person.
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.
FS::Record, schema.html from the base documentation.