don't use decimal minutes in call detail format
authormark <mark>
Mon, 27 Sep 2010 22:59:47 +0000 (22:59 +0000)
committermark <mark>
Mon, 27 Sep 2010 22:59:47 +0000 (22:59 +0000)
FS/FS/cdr.pm
FS/FS/part_pkg/voip_cdr.pm

index 2406557..002e2d2 100644 (file)
@@ -560,11 +560,7 @@ sub export_formats {
     elsif ( $opt{granularity} == 60 ) {#full minutes
       return sprintf("%.0fm",$sec/60);
     }
-    elsif ( $opt{granularity} == 6 || 
-            $opt{granularity} == 30 ) {#tenths or halves
-      return sprintf("%.01fm",$sec/60);
-    }
-    else { #seconds, or unspecified
+    else { #anything else
       return sprintf("%dm %ds", $sec/60, $sec%60);
     }
   };
index e067af5..8294bed 100644 (file)
@@ -561,7 +561,9 @@ sub calc_usage {
 
         @call_details = ($cdr->downstream_csv( 'format'  => $output_format,
                                                'charge'  => $charge,
-                                               'seconds' => $seconds,
+                                               'seconds' => ($use_duration ? 
+                                                             $cdr->duration : 
+                                                             $cdr->billsec),
                                                'granularity' => $granularity,
                                              )
                         );
@@ -685,7 +687,9 @@ sub calc_usage {
           @call_details = (
             $cdr->downstream_csv( 'format'         => $output_format,
                                   'granularity'    => $rate_detail->sec_granularity, 
-                                  'seconds'        => $seconds,
+                                  'seconds'        => ($use_duration ?
+                                                       $cdr->duration :
+                                                       $cdr->billsec),
                                   'charge'         => $charge,
                                   'pretty_dst'     => $pretty_destnum,
                                   'dst_regionname' => $regionname,