[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm, 1.79.2.5, 1.79.2.6
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Jun 28 13:48:06 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv14221
Modified Files:
Tag: FREESIDE_1_9_BRANCH
voip_cdr.pm
Log Message:
correct connection charge calculation
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.79.2.5
retrieving revision 1.79.2.6
diff -u -w -d -r1.79.2.5 -r1.79.2.6
--- voip_cdr.pm 11 May 2010 06:57:53 -0000 1.79.2.5
+++ voip_cdr.pm 28 Jun 2010 20:48:04 -0000 1.79.2.6
@@ -452,6 +452,7 @@
# } else { #pass upstream price through
#
# $charge = sprintf('%.2f', $cdr->upstream_price);
+# warn "Incrementing \$charges by $charge. Now $charges\n" if $DEBUG;
# $charges += $charge;
#
# @call_details = (
@@ -470,6 +471,7 @@
#XXX $charge = sprintf('%.2f', $cdr->upstream_price);
$charge = sprintf('%.3f', $cdr->upstream_price);
$charges += $charge;
+ warn "Incrementing \$charges by $charge. Now $charges\n" if $DEBUG;
@call_details = ($cdr->downstream_csv( 'format' => $output_format,
'charge' => $charge,
@@ -500,6 +502,7 @@
$charge = sprintf('%.4f', ( $self->option('min_charge') * $minutes )
+ 0.0000000001 ); #so 1.00005 rounds to 1.0001
+ warn "Incrementing \$charges by $charge. Now $charges\n" if $DEBUG;
$charges += $charge;
@call_details = ($cdr->downstream_csv( 'format' => $output_format,
@@ -553,13 +556,14 @@
$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;
}
More information about the freeside-commits
mailing list