diff options
author | ivan <ivan> | 2008-08-29 01:09:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-08-29 01:09:09 +0000 |
commit | c47123a101c99b35c3c7b1be5b003b773ae00e06 (patch) | |
tree | abecb0c0da3a7b65ce5d787960a852c5cb05fbad /FS | |
parent | d7b220cb7443a6d55723e4b5b9d483504efe9250 (diff) |
add CDR batch TFTP feature, RT#3113
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Schema.pm | 4 | ||||
-rw-r--r-- | FS/FS/cdr.pm | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 2043b45ec..94a56248b 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1921,10 +1921,12 @@ sub tables_hashref { #NULL, done (or something) 'freesidestatus', 'varchar', 'NULL', 32, '', '', + 'cdrbatch', 'varchar', 'NULL', $char_d, '', '', + ], 'primary_key' => 'acctid', 'unique' => [], - 'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ] ], + 'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ], [ 'cdrbatch' ], ], }, 'cdr_calltype' => { diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index 439d5ae69..8b09e4ec4 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -129,6 +129,8 @@ following fields are currently supported: =item freesidestatus - NULL, done (or something) +=item cdrbatch + =back =head1 METHODS @@ -617,6 +619,7 @@ sub batch_import { my $fh = $param->{filehandle}; my $format = $param->{format}; + my $cdrbatch = $param->{cdrbatch}; return "Unknown format $format" unless exists( $cdr_info{$format} ) @@ -699,6 +702,8 @@ sub batch_import { } @{ $info->{'import_fields'} } ; + + $cdr{cdrbatch} = $cdrbatch; my $cdr = new FS::cdr ( \%cdr ); @@ -732,7 +737,7 @@ sub batch_import { $dbh->commit or die $dbh->errstr if $oldAutoCommit; #might want to disable this if we skip records for any reason... - return "Empty file!" unless $imported; + return "Empty file!" unless $imported || $param->{empty_ok}; ''; |