Difference between revisions of "Freeside:3:Documentation:Developer/FS/sales"
From Freeside
m (Edit via perl MediaWiki framework (1.13)) |
m (Edit via perl MediaWiki framework (1.13)) |
||
Line 18: | Line 18: | ||
</code> | </code> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
− | An FS::sales object represents | + | An FS::sales object represents a sales person. FS::sales inherits from FS::Record. The following fields are currently supported: |
; salesnum | ; salesnum | ||
Line 29: | Line 29: | ||
==METHODS== | ==METHODS== | ||
; new HASHREF | ; new HASHREF | ||
− | :Creates a new | + | :Creates a new sales person. To add the sales person to the database, see [[#insert|"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. | :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. | ||
Line 39: | Line 39: | ||
:Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. | :Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. | ||
; check | ; check | ||
− | :Checks all fields to make sure this is a valid | + | :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 [[Freeside:3:Documentation:Developer/FS/cust main|FS::cust_main]]), if any, for this sales person. | ||
+ | ; cust_bill_pkg START END OPTIONS | ||
+ | :Returns the package line items (see [[Freeside:3:Documentation:Developer/FS/cust bill pkg|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== | ==BUGS== | ||
− | |||
− | |||
==SEE ALSO== | ==SEE ALSO== | ||
[[Freeside:3:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation. | [[Freeside:3:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation. |
Revision as of 13:39, 27 June 2014
Contents
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
- agentnum
- agentnum
- disabled
- disabled
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.