diff options
author | mark <mark> | 2010-07-01 01:53:50 +0000 |
---|---|---|
committer | mark <mark> | 2010-07-01 01:53:50 +0000 |
commit | de3bf373e97f6875e09fc17d99068a2716bf3b2d (patch) | |
tree | bf5d4908cb57519a99cb8db0266f40d671f9e170 /FS/FS/rate_detail.pm | |
parent | 6643a544400f5bed64b75720fdaccb41f01d1e79 (diff) |
voip_cdr call rating by day and time, RT#4763
Diffstat (limited to 'FS/FS/rate_detail.pm')
-rw-r--r-- | FS/FS/rate_detail.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm index f6cdedf..7b90452 100644 --- a/FS/FS/rate_detail.pm +++ b/FS/FS/rate_detail.pm @@ -5,6 +5,7 @@ use vars qw( @ISA $DEBUG $me ); 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); @@ -54,6 +55,8 @@ inherits from FS::Record. The following fields are currently supported: =item classnum - usage class (see L<FS::usage_class>) if any for this rate +=item ratetimenum - rating time period (see L<FS::rate_time) if any + =back =head1 METHODS @@ -194,6 +197,30 @@ sub dest_prefixes_short { $self->dest_region->prefixes_short; } +=item rate_time + +Returns the L<FS::rate_time> object associated with this call +plan rate, if there is one. + +=cut + +sub rate_time { + my $self = shift; + $self->ratetimenum ? FS::rate_time->by_key($self->ratetimenum) : (); +} + +=item rate_time_name + +Returns the I<ratetimename> field of the L<FS::rate_time> object +associated with this rate plan. + +=cut + +sub rate_time_name { + my $self = shift; + $self->ratetimenum ? $self->rate_time->ratetimename : '(default)'; +} + =item classname Returns the name of the usage class (see L<FS::usage_class>) associated with |