projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0a78989
)
swap price to last column in default CDR output format; fix "all 0 prices" when using...
author
ivan
<ivan>
Tue, 6 Jan 2009 21:16:18 +0000
(21:16 +0000)
committer
ivan
<ivan>
Tue, 6 Jan 2009 21:16:18 +0000
(21:16 +0000)
FS/FS/cdr.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
3c806f4
..
dc94bcf
100644
(file)
--- a/
FS/FS/cdr.pm
+++ b/
FS/FS/cdr.pm
@@
-436,11
+436,11
@@
my %export_names = (
},
'default' => {
'name' => 'Default',
},
'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',
},
'source_default' => {
'name' => 'Default with source',
- 'invoice_header' => 'Caller,Date,Time,
Duration,Number,Destin
ation,Price',
+ 'invoice_header' => 'Caller,Date,Time,
Number,Destination,Dur
ation,Price',
},
);
},
);
@@
-466,7
+466,8
@@
my %export_formats = (
'userfield', #USER
'dst', #NUMBER_DIALED
sub { sprintf('%.2fm', shift->billsec / 60 ) }, #DURATION
'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
],
'simple2' => [
sub { time2str('%D', shift->calldate_unix ) }, #DATE
@@
-475,7
+476,8
@@
my %export_formats = (
'dst', #NUMBER_DIALED
'src', #called from
sub { sprintf('%.2fm', shift->billsec / 60 ) }, #DURATION
'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' => [
],
'default' => [
@@
-487,6
+489,12
@@
my %export_formats = (
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
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' );
#DURATION
sub { my($cdr, %opt) = @_;
$opt{minutes}. ( $opt{granularity} ? 'm' : ' call' );
@@
-495,19
+503,9
@@
my %export_formats = (
#PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },
#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 ) = @_;
sub downstream_csv {
my( $self, %opt ) = @_;
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
4f41764
..
09789d9
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-381,7
+381,10
@@
sub calc_recur {
$charge = sprintf('%.3f', $cdr->upstream_price);
$charges += $charge;
$charge = sprintf('%.3f', $cdr->upstream_price);
$charges += $charge;
- @call_details = ($cdr->downstream_csv( 'format' => $output_format ));
+ @call_details = ($cdr->downstream_csv( 'format' => $output_format,
+ 'charge' => $charge,
+ )
+ );
$classnum = $cdr->calltypenum;
} else {
$classnum = $cdr->calltypenum;
} else {