From: Moritz Bunkus Date: Tue, 30 Apr 2013 15:07:32 +0000 (+0200) Subject: CSV-Import: Neu anlegen gefixt X-Git-Tag: release-3.1.0beta1~439 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e0811efeffea10076fc8ab4db310b4c5187ef293;p=kivitendo-erp.git CSV-Import: Neu anlegen gefixt Wenn noch kein Objekt existierte und auch keine Nummernspalte angegeben war, so wurde nur der allererste Eintrag neu angelegt, der Rest als angeblich schon existierend nicht behandelt. --- diff --git a/SL/Controller/CsvImport/Contact.pm b/SL/Controller/CsvImport/Contact.pm index 5ca2ae848..2eb877e97 100644 --- a/SL/Controller/CsvImport/Contact.pm +++ b/SL/Controller/CsvImport/Contact.pm @@ -47,7 +47,7 @@ sub check_objects { if ($object->cp_id) { my $existing_contact = $contacts_by_id{ $object->cp_id }; if (!$existing_contact) { - $contacts_by_id{ $object->cp_id } = $object; + $contacts_by_id{ $object->cp_id } = $object if $object->cp_id; } elsif ($update_policy eq 'skip') { push(@{ $entry->{errors} }, $::locale->text('Skipping due to existing entry in database')); diff --git a/SL/Controller/CsvImport/CustomerVendor.pm b/SL/Controller/CsvImport/CustomerVendor.pm index f8774dcfc..96eb69691 100644 --- a/SL/Controller/CsvImport/CustomerVendor.pm +++ b/SL/Controller/CsvImport/CustomerVendor.pm @@ -77,7 +77,7 @@ sub check_objects { my $existing_vc = $vcs_by_number{ $object->$numbercolumn }; if (!$existing_vc) { - $vcs_by_number{ $object->$numbercolumn } = $object; + $vcs_by_number{ $object->$numbercolumn } = $object if $object->$numbercolumn; } elsif ($update_policy eq 'skip') { push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry in database'));