%info = (
'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table',
'shortname' => 'VoIP/telco CDR rating (standard)',
%info = (
'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table',
'shortname' => 'VoIP/telco CDR rating (standard)',
#false laziness w/flat.pm
'recur_temporality' => { 'name' => 'Charge recurring fee for period',
'type' => 'select',
'select_options' => \%temporalities,
},
#false laziness w/flat.pm
'recur_temporality' => { 'name' => 'Charge recurring fee for period',
'type' => 'select',
'select_options' => \%temporalities,
},
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');
my $disable_tollfree = $self->option('disable_tollfree');
my $ignore_unrateable = $self->option('ignore_unrateable', 'Hush!');
my $use_duration = $self->option('use_duration');
my $disable_tollfree = $self->option('disable_tollfree');
my $ignore_unrateable = $self->option('ignore_unrateable', 'Hush!');
my $use_duration = $self->option('use_duration');
my $output_format = $self->option('output_format', 'Hush!')
|| ( $rating_method eq 'upstream_simple'
my $output_format = $self->option('output_format', 'Hush!')
|| ( $rating_method eq 'upstream_simple'
); # $last_bill, $$sdate )
$options{'by_svcnum'} = 1 if $svc_field eq 'svcnum';
); # $last_bill, $$sdate )
$options{'by_svcnum'} = 1 if $svc_field eq 'svcnum';
if $seconds # don't granular-ize 0 billsec calls (bills them)
&& $granularity # 0 is per call
&& $seconds % $granularity;
if $seconds # don't granular-ize 0 billsec calls (bills them)
&& $granularity # 0 is per call
&& $seconds % $granularity;
- my $minutes = $seconds / 60;
- # XXX config?
- #$charge = sprintf('%.2f', ( $self->option('min_charge') * $minutes )
- #+ 0.00000001 ); #so 1.005 rounds to 1.01
+ my $minutes = $granularity ? ($seconds / 60) : 1;
$charge = sprintf('%.4f', ( $self->option('min_charge') * $minutes )
+ 0.0000000001 ); #so 1.00005 rounds to 1.0001
$charge = sprintf('%.4f', ( $self->option('min_charge') * $minutes )
+ 0.0000000001 ); #so 1.00005 rounds to 1.0001
my $charge_min = 0 - $included_min{$regionnum}{$ratetimenum}; #XXX should preserve
#(display?) this
$included_min{$regionnum}{$ratetimenum} = 0;
my $charge_min = 0 - $included_min{$regionnum}{$ratetimenum}; #XXX should preserve
#(display?) this
$included_min{$regionnum}{$ratetimenum} = 0;
# choose next rate_detail
$rate_detail = $rate->dest_detail({ 'countrycode' => $countrycode,
'phonenum' => $number,
# choose next rate_detail
$rate_detail = $rate->dest_detail({ 'countrycode' => $countrycode,
'phonenum' => $number,
warn " adding details on charge to invoice: [ ".
join(', ', @{$call_details} ). " ]"
if ( $DEBUG && ref($call_details) );
warn " adding details on charge to invoice: [ ".
join(', ', @{$call_details} ). " ]"
if ( $DEBUG && ref($call_details) );