% if ( $error ) {
0,"<% $error %>",,
% } else {
-1,"CDR import successful',<% $cdr_batch->cdrbatchnum %>,"<% $cdrbatch %>"
+1,"CDR import successful",<% $cdr_batch->cdrbatchnum %>,"<% $cdrbatch %>"
% }
<%init>
my $error = '';
my $cdr_batch;
+my $cdrbatch = '';
{
my $csv = new Text::CSV_XS or die Text::CSV->error_diag;
- my $cdrbatch = time2str('post-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+ $cdrbatch = time2str('post-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
$cdr_batch = new FS::cdr_batch { 'cdrbatch' => $cdrbatch };
$error = $cdr_batch->insert and last;
}
+$error =~ s/"/""/g; #CSV
+
</%init>