[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.86,1.87
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Jun 28 13:47:36 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv14177
Modified Files:
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.86
retrieving revision 1.87
diff -u -w -d -r1.86 -r1.87
--- voip_cdr.pm 28 Jun 2010 08:12:02 -0000 1.86
+++ voip_cdr.pm 28 Jun 2010 20:47:34 -0000 1.87
@@ -477,6 +477,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 = (
@@ -495,6 +496,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,
@@ -525,6 +527,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,
@@ -578,13 +581,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