X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Frate_detail.pm;h=7b90452055627016ff445c0cf64ca1de8468cff7;hb=387c96b0d8f224f3ade27bed9348f37b432bbb8a;hp=b7b23babe52843934c3cc5e4edbc36c30f1fbbf0;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm index b7b23babe..7b9045205 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) if any for this rate +=item ratetimenum - rating time period (see Ldest_region->prefixes_short; } +=item rate_time + +Returns the L 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 field of the L 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) associated with @@ -232,6 +259,31 @@ sub granularities { %granularities; } +=item conn_secs + + Returns an (ordered) hash of conn_sec => name pairs + +=cut + +tie my %conn_secs, 'Tie::IxHash', + '0' => 'connection', + '1' => 'first second', + '6' => 'first 6 seconds', + '30' => 'first 30 seconds', # '1/2 minute', + '60' => 'first minute', + '120' => 'first 2 minutes', + '180' => 'first 3 minutes', + '300' => 'first 5 minutes', +; + +sub conn_secs { + %conn_secs; +} + +=item process_edit_import + +=cut + use Storable qw(thaw); use Data::Dumper; use MIME::Base64; @@ -311,6 +363,10 @@ sub process_edit_import { } +=item edit_import + +=cut + #false laziness w/ #FS::Record::batch_import, grep "edit_import" for differences #could be turned into callbacks or something use Text::CSV_XS; @@ -569,8 +625,6 @@ sub edit_import { } - - =back =head1 BUGS