Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 531aada2

Von Bernd Bleßmann vor mehr als 10 Jahren hinzugefügt

  • ID 531aada2daa8be0b86a5426e3c576037ea560657
  • Vorgänger 4c313ecf
  • Nachfolger cd3150ed

CsvImport Waren: Code-Vereinfachung

Unterschiede anzeigen:

SL/Controller/CsvImport/Part.pm
210 210
    );
211 211
  }
212 212

  
213
  if ($self->settings->{article_number_policy} eq 'update_prices') {
214
    if ($object->partnumber && $self->parts_by->{partnumber}{$object->partnumber}) {
215
      push @{ $entry->{information} }, $::locale->text('Updating prices of existing entry in database');
216
    }
217
    if ($entry->{part}) {
213
  if ($entry->{part}) {
214
    if ($self->settings->{article_number_policy} eq 'update_prices') {
218 215
      map { $entry->{part}->$_( $object->$_ ) if defined $object->$_ } qw(sellprice listprice lastcost);
219 216

  
220 217
      # merge prices
......
223 220

  
224 221
      push @{ $entry->{information} }, $::locale->text('Updating prices of existing entry in database');
225 222
      $entry->{object_to_save} = $entry->{part};
223
    } elsif ( $self->settings->{article_number_policy} eq 'skip' ) {
224
      push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry in database'));
225
    } else {
226
      $object->partnumber('####');
226 227
    }
227
  } elsif ( $self->settings->{article_number_policy} eq 'skip' ) {
228
    push(@{$entry->{errors}}, $::locale->text('Skipping due to existing entry in database')) if ( $entry->{part} );
229
  } else {
230
    $object->partnumber('####') if $entry->{part};
231 228
  }
232 229
}
233 230

  
231

  
234 232
sub handle_prices {
235 233
  my ($self, $entry) = @_;
236 234

  

Auch abrufbar als: Unified diff