[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm,1.19,1.20

Jeff Finucane,420,, jeff at wavetail.420.am
Fri Aug 1 21:20:21 PDT 2008


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

Modified Files:
	voip_cdr.pm 
Log Message:
bundled package presentation improvements

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- voip_cdr.pm	2 Aug 2008 04:10:01 -0000	1.19
+++ voip_cdr.pm	2 Aug 2008 04:20:17 -0000	1.20
@@ -158,6 +158,10 @@
   my $output_format = $self->option('output_format', 'Hush!')
                       || 'simple';
 
+  eval "use Text::CSV_XS;";
+  die $@ if $@;
+  my $csv = new Text::CSV_XS;
+
   foreach my $cust_svc (
     grep { $_->part_svc->svcdb eq 'svc_phone' } $cust_pkg->cust_svc
   ) {
@@ -298,7 +302,7 @@
 
           $charge = sprintf('%.2f', $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
@@ -383,10 +387,9 @@
           if ( $self->option('rating_method') eq 'upstream_simple' ) {
             $call_details = [ 'C', $call_details[0] ];
           }else{
-            $call_details = join(' - ', @call_details );
+            $csv->combine(@call_details);
+            $call_details = [ 'C', $csv->string ];
           }
-          warn "  adding details on charge to invoice: $call_details"
-            if ( $DEBUG && !ref($call_details) );
           warn "  adding details on charge to invoice: [ ".
               join(', ', @{$call_details} ). " ]"
             if ( $DEBUG && ref($call_details) );
@@ -476,7 +479,7 @@
     'quantity'  => $cust_pkg->quantity,
     'sdate'     => $$sdate,
     'edate'     => $cust_pkg->bill,             # already fiddled
-    'itemdesc'  => 'Call details',              # configurable?
+    'itemdesc'  => 'Usage charges',             # configurable?
     'details'   => \@details,
   };
 



More information about the freeside-commits mailing list