[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.14,1.15

Jeff Finucane,420,, jeff at wavetail.420.am
Fri May 16 12:26:43 PDT 2008


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

Modified Files:
	voip_cdr.pm 
Log Message:
typeset CDRs into 5 columns on invoices

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- voip_cdr.pm	14 May 2008 18:07:23 -0000	1.14
+++ voip_cdr.pm	16 May 2008 19:26:38 -0000	1.15
@@ -292,15 +292,7 @@
         $charge = sprintf('%.3f', $cdr->upstream_price);
         $charges += $charge;
 
-        @call_details = (
-          #time2str("%Y %b %d - %r", $cdr->calldate_unix ),
-          time2str("%c", $cdr->calldate_unix),  #XXX this should probably be a config option dropdown so they can select US vs- rest of world dates or whatnot
-          sprintf('%.2f', $cdr->billsec / 60 ).'m',
-          '$'.$charge, #XXX $money_char
-          #$pretty_destnum,
-          $cdr->userfield, #$rate_region->regionname,
-          $cdr->dst,
-        );
+        @call_details = ( $cdr->downstream_csv( 'format' => 'voxlinesystems' ));
 
       } else {
         die "don't know how to rate CDRs using method: ".
@@ -363,7 +355,12 @@
         }
 
         if ( $charge > 0 ) {
-          my $call_details = join(' - ', @call_details );
+          my $call_details;
+          if ( $self->option('rating_method') eq 'upstream_simple' ) {
+            $call_details = [ 'C', $call_details[0] ];
+          }else{
+            $call_details = join(' - ', @call_details );
+          }
           warn "  adding details on charge to invoice: $call_details"
             if $DEBUG;
           push @$details, $call_details; #\@call_details,
@@ -382,6 +379,9 @@
 
     } # $cdr
 
+    unshift @$details, [ 'C', "Date,Time,Name,Destination,Duration,Price" ]
+      if (@$details && $self->option('rating_method') eq 'upstream_simple' );
+
   } # $cust_svc
 
   if ( $spool_cdr && length($downstream_cdr) ) {



More information about the freeside-commits mailing list