X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fvoip_cdr.pm;h=8720bb66816940c2fadc8ff23e931bc538c20650;hb=e3dffa23a03cd9f88946ceb78bc75ada29bc013a;hp=ea160315b17f127147208117d2c16bcdccf45988;hpb=9464e3517fcae6a735c14b3fb15b91f3886a884a;p=freeside.git diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index ea160315b..8720bb668 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -27,6 +27,7 @@ tie my %rating_method, 'Tie::IxHash', %info = ( 'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table', + 'shortname' => 'VoIP/telco CDR rating (standard)', 'fields' => { 'setup_fee' => { 'name' => 'Setup fee for this package', 'default' => 0, @@ -207,7 +208,7 @@ sub calc_recur { }); # - die "Can't find rate for call $to_or_from +$countrycode $\numbern" + die "Can't find rate for call $to_or_from +$countrycode $number\n" unless $rate_prefix; $regionnum = $rate_prefix->regionnum; @@ -278,9 +279,10 @@ sub calc_recur { unless exists $included_min{$regionnum}; my $granularity = $rate_detail->sec_granularity; - my $seconds = $cdr->billsec; # |ength($cdr->billsec) ? $cdr->billsec : $cdr->duration; + my $seconds = $cdr->billsec; # length($cdr->billsec) ? $cdr->billsec : $cdr->duration; $seconds += $granularity - ( $seconds % $granularity ) - if $granularity; # 0 is per call + if $seconds # don't granular-ize 0 billsec calls (bills them) + && $granularity; # 0 is per call my $minutes = sprintf("%.1f", $seconds / 60); $minutes =~ s/\.0$// if $granularity == 60;