[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.82,1.83
Ivan,,,
ivan at wavetail.420.am
Sun Mar 21 16:13:26 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv11324/FS/FS/part_pkg
Modified Files:
voip_cdr.pm
Log Message:
connection fee for initial N seconds support, RT#7018
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -w -d -r1.82 -r1.83
--- voip_cdr.pm 30 Dec 2009 06:41:43 -0000 1.82
+++ voip_cdr.pm 21 Mar 2010 23:13:24 -0000 1.83
@@ -535,6 +535,9 @@
# length($cdr->billsec) ? $cdr->billsec : $cdr->duration;
$seconds = $use_duration ? $cdr->duration : $cdr->billsec;
+ $seconds -= $rate_detail->conn_sec;
+ $seconds = 0 if $seconds < 0;
+
$seconds += $granularity - ( $seconds % $granularity )
if $seconds # don't granular-ize 0 billsec calls (bills them)
&& $granularity; # 0 is per call
@@ -546,12 +549,15 @@
$included_min{$regionnum} -= $minutes;
+ $charge = sprintf('%.2f', $rate_detail->conn_charge);
+
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 )
+ $charge += sprintf('%.2f', ($rate_detail->min_charge * $charge_min)
+ 0.00000001 ); #so 1.005 rounds to 1.01
+ $charge = sprintf('%.2f', $charge);
$charges += $charge;
}
More information about the freeside-commits
mailing list