X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Frate_detail.pm;h=d81d9dbda61b685040080e3ec5d1bcc5fba47485;hb=3a7f3a2e81cc7423ba9a08fd4b28b3b5f4f227a2;hp=7b90452055627016ff445c0cf64ca1de8468cff7;hpb=de3bf373e97f6875e09fc17d99068a2716bf3b2d;p=freeside.git diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm index 7b9045205..d81d9dbda 100644 --- a/FS/FS/rate_detail.pm +++ b/FS/FS/rate_detail.pm @@ -1,14 +1,13 @@ package FS::rate_detail; +use base qw(FS::Record); use strict; -use vars qw( @ISA $DEBUG $me ); +use vars qw( $DEBUG $me ); +use Tie::IxHash; use FS::Record qw( qsearch qsearchs dbh ); use FS::rate; use FS::rate_region; use FS::rate_time; -use Tie::IxHash; - -@ISA = qw(FS::Record); $DEBUG = 0; $me = '[FS::rate_detail]'; @@ -57,6 +56,10 @@ inherits from FS::Record. The following fields are currently supported: =item ratetimenum - rating time period (see L) if any for this rate + +=item region_group - Group in region group for rate plan + =back =head1 METHODS @@ -126,11 +129,15 @@ sub check { #|| $self->ut_money('min_charge') #good enough for now... + || $self->ut_floatn('conn_charge') + || $self->ut_floatn('conn_cost') || $self->ut_float('min_charge') + || $self->ut_floatn('min_cost') || $self->ut_number('sec_granularity') || $self->ut_foreign_keyn('classnum', 'usage_class', 'classnum' ) + || $self->ut_enum('region_group', [ '', 'Y' ]) ; return $error if $error; @@ -142,13 +149,6 @@ sub check { Returns the parent call plan (see L) associated with this call plan rate. -=cut - -sub rate { - my $self = shift; - qsearchs('rate', { 'ratenum' => $self->ratenum } ); -} - =item orig_region Returns the origination region (see L) associated with this @@ -234,6 +234,20 @@ sub classname { $usage_class ? $usage_class->classname : ''; } +=item cdrtypename + +Returns the name of the CDR type (see Lcdrtypenum or return ''; + my $cdr_type = qsearchs('cdr_type', { cdrtypenum => $cdrtypenum }); + return $cdr_type ? $cdr_type->cdrtypename : $cdrtypenum; +} =back