From 21187f8b1b6904183bf887e8abed77bd807b4aa1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 19 Aug 2013 16:21:24 +0200 Subject: [PATCH] check_objects: Schleifen zusammengefasst. --- SL/Controller/CsvImport/Order.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index 8125a35bd..64e1d76e4 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -244,7 +244,10 @@ sub check_objects { if ($entry->{raw_data}->{datatype} eq $self->_order_column) { $self->handle_order($entry); + } elsif ($entry->{raw_data}->{datatype} eq $self->_item_column && $entry->{object}->can('part')) { + $self->handle_item($entry); } + } continue { $i++; } @@ -257,12 +260,6 @@ sub check_objects { $self->add_columns($self->_order_column, 'globalproject_id') if exists $self->controller->data->[0]->{raw_data}->{globalprojectnumber}; $self->add_columns($self->_order_column, 'cp_id') if exists $self->controller->data->[0]->{raw_data}->{contact}; - foreach my $entry (@{ $self->controller->data }) { - if ($entry->{raw_data}->{datatype} eq $self->_item_column && $entry->{object}->can('part')) { - $self->handle_item($entry); - } - } - $self->add_info_columns($self->_item_column, { header => $::locale->text('Part Number'), method => 'partnumber' }); # Todo: access via ->[1] ok? Better: search first item column and use this -- 2.20.1