Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 20599de5

Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt

  • ID 20599de536d3333628504f390310dbfbeb7fb5ad
  • Vorgänger 471af251
  • Nachfolger df71b475

CSV-Import Artikel: Einige Erweiterungen: Testfehler behoben

Unterschiede anzeigen:

SL/Controller/CsvImport/Part.pm
150 150

  
151 151
  $self->makemodel_columns({});
152 152

  
153
  my $i;
153
  my $i = 0;
154 154
  my $num_data = scalar @{ $self->controller->data };
155 155
  foreach my $entry (@{ $self->controller->data }) {
156 156
    $self->controller->track_progress(progress => $i/$num_data * 100) if $i % 100 == 0;
......
261 261
  my $raw = $entry->{raw_data};
262 262

  
263 263
  if ($object->partnumber && $self->parts_by->{partnumber}{$object->partnumber}) {
264
    $entry->{part} = SL::DB::Manager::Part->get_all( query => [ partnumber => $object->partnumber ], limit => 1,
265
      with_objects => [ 'translations', 'custom_variables' ]
266
    ) -> [0];
264
    $entry->{part} = SL::DB::Manager::Part->get_first( query => [ partnumber => $object->partnumber ], limit => 1,
265
      with_objects => [ 'translations', 'custom_variables' ], multi_many_ok => 1
266
    );
267 267
    if ( !$entry->{part} ) {
268
        $entry->{part} = SL::DB::Manager::Part->get_all( query => [ partnumber => $object->partnumber ], limit => 1,
269
          with_objects => [ 'translations' ]
270
        ) -> [0];
268
        $entry->{part} = SL::DB::Manager::Part->get_first( query => [ partnumber => $object->partnumber ], limit => 1,
269
          with_objects => [ 'translations' ], multi_many_ok => 1
270
        );
271 271
    }
272 272
  }
273 273

  
......
276 276
      push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry in database with different type'));
277 277
      return;
278 278
    }
279
    if ( $entry->{part}->unit != $object->unit || $entry->{part}->inventory_accno_id != $object->inventory_accno_id ) {
279
    if ( $entry->{part}->unit ne $object->unit || $entry->{part}->inventory_accno_id != $object->inventory_accno_id ) {
280 280
      if ( $entry->{part}->onhand != 0 || $self->_part_is_used($entry->{part})) {
281 281
        push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry with different unit or inventory_accno_id'));
282 282
        return;

Auch abrufbar als: Unified diff