projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DSL status pulling, RT#13656
[freeside.git]
/
FS
/
FS
/
cdr.pm
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
3157b6b
..
36721a8
100644
(file)
--- 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;
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';
}
$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';
my $min = int($sec/60);
$min++ if $sec%60;
return $min.'m';
@@
-620,7
+620,10
@@
sub export_formats {
$duration_sub,
#PRICE
$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} };
}
@{ $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;
my $status = $csv->combine(@columns);
die "FS::CDR: error combining ". $csv->error_input(). "into downstream CSV"
unless $status;
@@
-906,7
+911,7
@@
my %import_options = (
},
#drop the || 'csv' to allow auto xls for csv types?
},
#drop the || 'csv' to allow auto xls for csv types?
- 'format_types' => { map { $_ =>
( lc($cdr_info{$_}->{'type'}) || 'csv'
); }
+ 'format_types' => { map { $_ =>
lc($cdr_info{$_}->{'type'} || 'csv'
); }
keys %cdr_info
},
keys %cdr_info
},
@@
-943,6
+948,14
@@
sub batch_import {
my $iopt = _import_options;
$opt->{$_} = $iopt->{$_} foreach keys %$iopt;
my $iopt = _import_options;
$opt->{$_} = $iopt->{$_} foreach keys %$iopt;
+ if ( defined $opt->{'cdrtypenum'} ) {
+ $opt->{'preinsert_callback'} = sub {
+ my($record,$param) = (shift,shift);
+ $record->cdrtypenum($opt->{'cdrtypenum'});
+ '';
+ };
+ }
+
FS::Record::batch_import( $opt );
}
FS::Record::batch_import( $opt );
}