% 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::rate - Object methods for rate records
use FS::rate;
$record = new FS::rate \%hash;
$record = new FS::rate { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::rate object represents an rate plan. FS::rate inherits from FS::Record. The following fields are currently supported:
primary key
Rate name
Optional agent (see FS::agent) for agent-virtualized rates.
Optional rate detail to apply when a call doesn't match any region in the rate plan. If this is not set, the call will either be left unrated (though it may still be processed under a different pricing addon package), or be marked as 'skipped', or throw a fatal error, depending on the setting of the 'ignore_unrateable' package option.
Deprecated; we now find the default detail by its lack of regionnum.
Creates a new rate plan. To add the rate plan 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.
Currently available options are: rate_detail
If rate_detail is set to an array reference of FS::rate_detail objects, the objects will have their ratenum field set and will be inserted after this record.
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.
Currently available options are: rate_detail
If rate_detail is set to an array reference of FS::rate_detail objects, the objects will have their ratenum field set and will be inserted after this record. Any existing rate_detail records associated with this record will be deleted.
Checks all fields to make sure this is a valid rate plan. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the rate detail (see FS::rate_detail) for this rate to the specificed destination. If no rate can be found, returns the default rate if there is one, and an empty string otherwise.
Destination can be specified as an FS::rate_detail object or regionnum (see FS::rate_detail), or as a hashref containing the following keys:
Returns all region-specific details (see FS::rate_detail) for this rate.
Returns the default rate detail for CDRTYPENUM (or for null CDR type, if not specified).
Job-queue processor for web interface adds/edits
FS::Record, schema.html from the base documentation.
Hey! The above document had some coding errors, which are explained below:
Expected text after =item, not a bullet
You forgot a '=back' before '=head1'
You forgot a '=back' before '=head1'