[freeside-commits] freeside/FS/FS cdr.pm,1.29,1.30

Ivan,,, ivan at wavetail.420.am
Tue Jan 6 13:16:20 PST 2009


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

Modified Files:
	cdr.pm 
Log Message:
swap price to last column in default CDR output format; fix "all 0 prices" when using simple output format w/internal rating, RT#4503

Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cdr.pm	3 Jan 2009 01:52:59 -0000	1.29
+++ cdr.pm	6 Jan 2009 21:16:18 -0000	1.30
@@ -436,11 +436,11 @@
   },
   'default' => {
     'name'           => 'Default',
-    'invoice_header' => 'Date,Time,Duration,Price,Number,Destination',
+    'invoice_header' => 'Date,Time,Number,Destination,Duration,Price',
   },
   'source_default' => {
     'name'           => 'Default with source',
-    'invoice_header' => 'Caller,Date,Time,Duration,Number,Destination,Price',
+    'invoice_header' => 'Caller,Date,Time,Number,Destination,Duration,Price',
   },
 );
 
@@ -466,7 +466,8 @@
     'userfield',                                     #USER
     'dst',                                           #NUMBER_DIALED
     sub { sprintf('%.2fm', shift->billsec / 60 ) },  #DURATION
-    sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
+    #sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
+    sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
   ],
   'simple2' => [
     sub { time2str('%D', shift->calldate_unix ) },   #DATE
@@ -475,7 +476,8 @@
     'dst',                                           #NUMBER_DIALED
     'src',                                           #called from
     sub { sprintf('%.2fm', shift->billsec / 60 ) },  #DURATION
-    sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
+    #sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
+    sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
   ],
   'default' => [
 
@@ -487,6 +489,12 @@
     sub { time2str('%r', shift->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
 
+    #DEST ("Number")
+    sub { my($cdr, %opt) = @_; $opt{pretty_dst} || $cdr->dst; },
+
+    #REGIONNAME ("Destination")
+    sub { my($cdr, %opt) = @_; $opt{dst_regionname}; },
+
     #DURATION
     sub { my($cdr, %opt) = @_;
           $opt{minutes}. ( $opt{granularity} ? 'm' : ' call' );
@@ -495,19 +503,9 @@
     #PRICE
     sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },
 
-    #DEST ("Number")
-    sub { my($cdr, %opt) = @_; $opt{pretty_dst} || $cdr->dst; },
-
-    #REGIONNAME ("Destination")
-    sub { my($cdr, %opt) = @_; $opt{dst_regionname}; },
-
   ],
 );
-$export_formats{'source_default'} = [ 'src',
-                                      @{ $export_formats{'default'} }[0..2],
-                                      @{ $export_formats{'default'} }[4..5],
-                                      @{ $export_formats{'default'} }[3],
-                                    ];
+$export_formats{'source_default'} = [ 'src', @{ $export_formats{'default'} }, ];
 
 sub downstream_csv {
   my( $self, %opt ) = @_;



More information about the freeside-commits mailing list