From: jeff Date: Mon, 28 Jun 2010 22:20:32 +0000 (+0000) Subject: connection charge handling which comports with history of module X-Git-Tag: root_of_svc_elec_features~110 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e6820a61a43c840ef08a11bdda41507dac2a9ff7 connection charge handling which comports with history of module --- diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 326f3cc58..614ea8266 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -15,7 +15,7 @@ use FS::part_pkg::recur_Common; @ISA = qw(FS::part_pkg::recur_Common); -$DEBUG = 0; +$DEBUG = 1; tie my %cdr_svc_method, 'Tie::IxHash', 'svc_phone.phonenum' => 'Phone numbers (svc_phone.phonenum)', @@ -581,16 +581,16 @@ sub calc_usage { $charge = sprintf('%.2f', $rate_detail->conn_charge); - if ( $included_min{$regionnum} <= 0 ) { + if ( $included_min{$regionnum} < 0 ) { my $charge_min = 0 - $included_min{$regionnum}; #XXX should preserve #(display?) this $included_min{$regionnum} = 0; $charge += sprintf('%.2f', ($rate_detail->min_charge * $charge_min) + 0.00000001 ); #so 1.005 rounds to 1.01 $charge = sprintf('%.2f', $charge); - warn "Incrementing \$charges by $charge. Now $charges\n" if $DEBUG; - $charges += $charge; } + warn "Incrementing \$charges by $charge. Now $charges\n" if $DEBUG; + $charges += $charge; # this is why we need regionnum/rate_region.... warn " (rate region $rate_region)\n" if $DEBUG;