% 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::quotation - Object methods for quotation records
use FS::quotation;
$record = new FS::quotation \%hash;
$record = new FS::quotation { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::quotation object represents a quotation. FS::quotation inherits from FS::Record. The following fields are currently supported:
primary key
prospectnum
custnum
_date
disabled
usernum
projected date when the quotation will be closed
projected confidence (expressed as integer) that quotation will close
Creates a new quotation. To add the quotation 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 quotation. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
HTML links to either the customer or prospect.
Returns a list consisting of two elements. The first is a text label for the link, and the second is the URL.
If this quotation already belongs to a customer, then returns that customer, as an FS::cust_main object.
Otherwise, creates a new customer (FS::cust_main object and record, and associated) based on this quotation's prospect, then orders this quotation's packages as real packages for the customer.
If there is an error, returns an error message, otherwise, returns the newly-created FS::cust_main object.
Accepts the same params as "order".
This method is for use with quotations which are already associated with a customer.
Orders this quotation's packages as real packages for the customer.
If there is an error, returns an error message, otherwise returns false.
If HASHREF is passed, it will be filled with a hash mapping the quotationpkgnum of each quoted package to the pkgnum of the package as ordered.
If PARAMS hashref is passed, the following params are accepted:
onhold - if true, suspends newly ordered packages
One-time charges, like FS::cust_main::charge()
Disables this quotation (sets disabled to Y, which hides the quotation on prospects and customers).
If there is an error, returns an error message, otherwise returns false.
Enables this quotation.
If there is an error, returns an error message, otherwise returns false.
Calculates current prices for all items on this quotation, including discounts and taxes, and updates the quotation_pkg records accordingly.
Class method which returns an SQL WHERE fragment to search for parameters specified in HASHREF. Valid parameters are
List reference of start date, end date, as UNIX timestamps.
List reference of charged limits (exclusive).
List reference of charged limits (exclusive).
flag, return open invoices only
flag, return net invoices only
Note: validates all passed-in data; i.e. safe to use with unchecked CGI params.
Return line item hashes for each package on this quotation. Differs from the base FS::Template_Mixin version in that it recalculates each quoted package first, and doesn't implement the "condensed" option.
FS::Record, schema.html from the base documentation.