[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm, 1.79.2.9, 1.79.2.10

Jeff Finucane,420,, jeff at wavetail.420.am
Tue Jul 13 17:17:53 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv20882

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	voip_cdr.pm 
Log Message:
third time's a charm - fix a small bug and make more analogous to HEAD - RT#8605

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.79.2.9
retrieving revision 1.79.2.10
diff -u -w -d -r1.79.2.9 -r1.79.2.10
--- voip_cdr.pm	13 Jul 2010 23:06:10 -0000	1.79.2.9
+++ voip_cdr.pm	14 Jul 2010 00:17:51 -0000	1.79.2.10
@@ -538,18 +538,18 @@
           my $granularity = $rate_detail->sec_granularity;
 
                       # length($cdr->billsec) ? $cdr->billsec : $cdr->duration;
-          my $charge_sec = $seconds =
-            $use_duration ? $cdr->duration : $cdr->billsec;
+          my $charge_sec = $use_duration ? $cdr->duration : $cdr->billsec;
+          $seconds = ( $charge_sec <= $rate_detail->conn_sec ) # min()
+                       ? $charge_sec
+                       : $rate_detail->conn_sec;
 
           $charge_sec -= $rate_detail->conn_sec;
           $charge_sec = 0 if $charge_sec < 0;
 
-          if ( $seconds && $granularity ) {
-            # don't granular-ize 0 billsec calls (bills them)
-            # 0 granularity is per call
-            $seconds += $granularity - ( $seconds % $granularity );
-            $charge_sec += $granularity - ( $charge_sec % $granularity );
-          }
+          $charge_sec += $granularity - ( $charge_sec % $granularity )
+            if $charge_sec   # don't granular-ize 0 billsec calls (bills them)
+            && $granularity; # 0 is per call
+          $seconds += $charge_sec;
 
           my $minutes = sprintf("%.1f", $charge_sec / 60);
           $minutes =~ s/\.0$// if $granularity == 60;



More information about the freeside-commits mailing list