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:
af49b2c
)
show post-granularity duration if available for all export formats
author
ivan
<ivan>
Wed, 1 Apr 2009 04:27:25 +0000
(
04:27
+0000)
committer
ivan
<ivan>
Wed, 1 Apr 2009 04:27:25 +0000
(
04:27
+0000)
FS/FS/cdr.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
2d92001
..
35bb71c
100644
(file)
--- a/
FS/FS/cdr.pm
+++ b/
FS/FS/cdr.pm
@@
-470,6
+470,15
@@
my %export_names = (
},
);
},
);
+my $duration_sub = sub {
+ my($cdr, %opt) = @_;
+ if ( $opt{minutes} ) {
+ $opt{minutes}. ( $opt{granularity} ? 'm' : ' call' );
+ } else {
+ sprintf('%.2fm', $cdr->billsec / 60 );
+ }
+};
+
my %export_formats = (
'convergent' => [
'carriername', #CARRIER
my %export_formats = (
'convergent' => [
'carriername', #CARRIER
@@
-491,7
+500,7
@@
my %export_formats = (
sub { time2str('%r', shift->calldate_unix ) }, #TIME
'userfield', #USER
'dst', #NUMBER_DIALED
sub { time2str('%r', shift->calldate_unix ) }, #TIME
'userfield', #USER
'dst', #NUMBER_DIALED
-
sub { sprintf('%.2fm', shift->billsec / 60 ) },
#DURATION
+
$duration_sub,
#DURATION
#sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
],
#sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
],
@@
-501,7
+510,7
@@
my %export_formats = (
#'userfield', #USER
'dst', #NUMBER_DIALED
'src', #called from
#'userfield', #USER
'dst', #NUMBER_DIALED
'src', #called from
-
sub { sprintf('%.2fm', shift->billsec / 60 ) },
#DURATION
+
$duration_sub,
#DURATION
#sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
],
#sub { sprintf('%.3f', shift->upstream_price ) }, #PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; }, #PRICE
],
@@
-522,9
+531,7
@@
my %export_formats = (
sub { my($cdr, %opt) = @_; $opt{dst_regionname}; },
#DURATION
sub { my($cdr, %opt) = @_; $opt{dst_regionname}; },
#DURATION
- sub { my($cdr, %opt) = @_;
- $opt{minutes}. ( $opt{granularity} ? 'm' : ' call' );
- },
+ $duration_sub,
#PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },
#PRICE
sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },