From a99ac2d9b3621c82b7aeddf85e9640442c42433c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 13 Feb 2015 13:32:08 +0100 Subject: [PATCH] =?utf8?q?Auftragsimport:=20Artikel=20auch=20nach=20Beschr?= =?utf8?q?eibung=20suchen=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CsvImport/Order.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index 9188556a4..246438c75 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -443,6 +443,17 @@ sub check_part { $object->parts_id($part->id); } + # Map description to ID if given. + if (!$object->parts_id && $entry->{raw_data}->{description}) { + my $part = $self->parts_by->{description}->{ $entry->{raw_data}->{description} }; + if (!$part) { + push @{ $entry->{errors} }, $::locale->text('Error: Invalid part'); + return 0; + } + + $object->parts_id($part->id); + } + if ($object->parts_id) { $entry->{info_data}->{partnumber} = $self->parts_by->{id}->{ $object->parts_id }->partnumber; } else { -- 2.20.1