Difference between revisions of "Freeside:4:Documentation:Developer/FS/rate detail"
From Freeside
(Edit via perl MediaWiki framework (1.13)) |
(No difference)
|
Latest revision as of 07:28, 18 November 2015
NAME
FS::rate_detail - Object methods for rate_detail records
SYNOPSIS
use FS::rate_detail; $record = new FS::rate_detail \%hash; $record = new FS::rate_detail { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check;
DESCRIPTION
An FS::rate_detail object represents an call plan rate. FS::rate_detail inherits from FS::Record. The following fields are currently supported:
- ratedetailnum - primary key; ratenum - rate plan (see FS::rate); orig_regionnum - call origination region; dest_regionnum - call destination region; min_included - included minutes; min_charge - charge per minute; sec_granularity - granularity in seconds, i.e. 6 or 60; 0 for per-call; classnum - usage class (see FS::usage_class) if any for this rate; ratetimenum - rating time period (see "FS::rate_time) if any"; cdrtypenum - CDR type (see FS::cdr_type) if any for this rate; region_group - Group in region group for rate plan; upstream_mult_charge - the multiplier to apply to the upstream price. Defaults to zero, and should stay zero unless this rate is intended to include a markup on pre-rated CDRs.; upstream_mult_cost - the multiplier to apply to the upstream price to calculate the wholesale cost.
METHODS
- new HASHREF
- Creates a new call plan rate. To add the call plan rate 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 call plan rate. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- rate
- Returns the parent call plan (see FS::rate) associated with this call plan rate.
- orig_region
- Returns the origination region (see FS::rate_region) associated with this call plan rate.
- dest_region
- Returns the destination region (see FS::rate_region) associated with this call plan rate.
- dest_regionname
- Returns the name of the destination region (see FS::rate_region) associated with this call plan rate.
- dest_prefixes_short
- Returns a short list of the prefixes for the destination region (see FS::rate_region) associated with this call plan rate.
- rate_time
- Returns the FS::rate_time object associated with this call plan rate, if there is one.
- rate_time_name
- Returns the ratetimename field of the FS::rate_time object associated with this rate plan.
- classname
- Returns the name of the usage class (see FS::usage_class) associated with this call plan rate.
- cdrtypename
- Returns the name of the CDR type (see "FS::cdr_type) associated with this rate, if there is one. If not, returns the cdrtypenum itself. This will only return an empty string if cdrtypenum is NULL."
SUBROUTINES
- granularities
Returns an (ordered) hash of granularity => name pairs
- conn_secs
Returns an (ordered) hash of conn_sec => name pairs
- process_edit_import; edit_import
BUGS
SEE ALSO
FS::rate, FS::rate_region, FS::Record, schema.html from the base documentation.
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 57:
- Unterminated L<...> sequence
- Around line 254:
- Unterminated L<...> sequence