Auftragsimport: nur Orders, nicht OrderItems explizit speichern.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 29 Nov 2013 09:10:46 +0000 (10:10 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 29 Nov 2013 09:10:46 +0000 (10:10 +0100)
SL/Controller/CsvImport/Order.pm

index 75ffd9b..907d900 100644 (file)
@@ -762,11 +762,12 @@ sub save_objects {
   # set order number and collect to save
   my $objects_to_save;
   foreach my $entry (@{ $self->controller->data }) {
+    next if $entry->{raw_data}->{datatype} ne $self->_order_column;
     next if @{ $entry->{errors} };
 
-    if ($entry->{raw_data}->{datatype} eq $self->_order_column && !$entry->{object}->ordnumber) {
-      my $number = SL::TransNumber->new(type        => 'sales_order',
-                                        save        => 1);
+    if (!$entry->{object}->ordnumber) {
+      my $number = SL::TransNumber->new(type => 'sales_order',
+                                        save => 1);
       $entry->{object}->ordnumber($number->create_unique());
     }