projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
FS
/
FS
/
cdr
/
Import.pm
diff --git
a/FS/FS/cdr/Import.pm
b/FS/FS/cdr/Import.pm
index
e788712
..
39a7772
100644
(file)
--- a/
FS/FS/cdr/Import.pm
+++ b/
FS/FS/cdr/Import.pm
@@
-34,7
+34,7
@@
CDR importing
=head1 CLASS METHODS
=head1 CLASS METHODS
-=item d
o_cl
i_import
+=item d
b
i_import
=cut
=cut
@@
-81,7
+81,7
@@
sub dbi_import {
# )
#my @cols = values %{ $args{column_map} };
# )
#my @cols = values %{ $args{column_map} };
- my $sql = "SELECT * FROM $table "; # join(',', @cols). " FROM $table ".
+ my $sql = "SELECT
$table.
* FROM $table "; # join(',', @cols). " FROM $table ".
$sql .= 'LEFT JOIN '. $args{status_table}.
" ON ( $table.$pkey = ". $args{status_table}. ".$pkey )"
if $args{status_table};
$sql .= 'LEFT JOIN '. $args{status_table}.
" ON ( $table.$pkey = ". $args{status_table}. ".$pkey )"
if $args{status_table};
@@
-117,13
+117,15
@@
sub dbi_import {
$cdr->cdrtypenum($opt{c}) if $opt{c};
$cdr->cdrtypenum($opt{c}) if $opt{c};
- #print $row->{$pkey},"\n" if $opt{v};
+ my $pkey_value = $row->{$pkey};
+
+ #print "$pkey_value\n" if $opt{v};
my $error = $cdr->insert;
if ($error) {
my $error = $cdr->insert;
if ($error) {
- #die
$row->{$pkey} . "
: failed import: $error\n";
- print
$row->{$pkey} . "
: failed import: $error\n";
+ #die
"$pkey_value
: failed import: $error\n";
+ print
"$pkey_value
: failed import: $error\n";
} else {
} else {
@@
-142,7
+144,7
@@
sub dbi_import {
}
}
- my $updated = $dbi->do($st_sql, undef, $
row->{$pkey}
);
+ my $updated = $dbi->do($st_sql, undef, $
pkey_value
);
#$updates += $updated;
die "failed to set status: ".$dbi->errstr."\n" unless $updated;
#$updates += $updated;
die "failed to set status: ".$dbi->errstr."\n" unless $updated;