From: Bernd Bleßmann Date: Mon, 19 Aug 2013 14:21:24 +0000 (+0200) Subject: check_objects: Schleifen zusammengefasst. X-Git-Tag: release-3.1.0beta1~22^2~126 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=21187f8b1b6904183bf887e8abed77bd807b4aa1;p=kivitendo-erp.git check_objects: Schleifen zusammengefasst. --- 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