From: ivan Date: Wed, 26 Mar 2008 03:04:33 +0000 (+0000) Subject: don't granular-ize 0 billsec calls into having a minimum charge X-Git-Tag: root_of_webpay_support~802 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=6f3d99ddb0889c3f75197b88a4cc1c785c483fe9;p=freeside.git don't granular-ize 0 billsec calls into having a minimum charge --- diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index ea160315b..72ef55ff0 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -278,9 +278,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;