summaryrefslogtreecommitdiff
path: root/FS/FS/cdr.pm
diff options
context:
space:
mode:
authorlevinse <levinse>2011-05-05 06:54:11 +0000
committerlevinse <levinse>2011-05-05 06:54:11 +0000
commit158103c8701d8cd87148c579dc101979c808b8c2 (patch)
tree04a67471629cd4b488e2ea4d87e3a225c5a7583b /FS/FS/cdr.pm
parent1c38324763201897c3ffeb12c530b46ea9ae62bb (diff)
self-service view usage customization and CDR display fixes, RT11761
Diffstat (limited to 'FS/FS/cdr.pm')
-rw-r--r--FS/FS/cdr.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm
index 3157b6b..0107659 100644
--- a/FS/FS/cdr.pm
+++ b/FS/FS/cdr.pm
@@ -560,11 +560,11 @@ sub export_formats {
my $duration_sub = sub {
my($cdr, %opt) = @_;
my $sec = $opt{seconds} || $cdr->billsec;
- if ( length($opt{granularity}) &&
+ if ( defined $opt{granularity} &&
$opt{granularity} == 0 ) { #per call
return '1 call';
}
- elsif ( $opt{granularity} == 60 ) {#full minutes
+ elsif ( defined $opt{granularity} && $opt{granularity} == 60 ) {#full minutes
my $min = int($sec/60);
$min++ if $sec%60;
return $min.'m';
@@ -620,7 +620,10 @@ sub export_formats {
$duration_sub,
#PRICE
- sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },
+ sub { my($cdr, %opt) = @_;
+ $opt{charge} = '0.00' unless defined $opt{charge};
+ $opt{money_char}.$opt{charge};
+ },
],
);
@@ -660,6 +663,8 @@ sub downstream_csv {
}
@{ $formats{$format} };
+ return @columns if defined $opt{'keeparray'};
+
my $status = $csv->combine(@columns);
die "FS::CDR: error combining ". $csv->error_input(). "into downstream CSV"
unless $status;