{ name => 'cusordnumber', description => $::locale->text('Customer Order Number') },
{ name => 'description', description => $::locale->text('Description') },
{ name => 'discount', description => $::locale->text('Discount') },
+ { name => 'ean', description => $::locale->text('EAN') },
{ name => 'lastcost', description => $::locale->text('Lastcost') },
{ name => 'longdescription', description => $::locale->text('Long Description') },
{ name => 'marge_percent', description => $::locale->text('Margepercent') },
$object->parts_id($part->id);
}
+ # Map ean to ID if given.
+ if (!$object->parts_id && $entry->{raw_data}->{ean}) {
+ my $part = $self->parts_by->{ean}->{ $entry->{raw_data}->{ean} };
+ if (!$part) {
+ push @{ $entry->{errors} }, $::locale->text('Error: Invalid part');
+ return 0;
+ }
+
+ $object->parts_id($part->id);
+ }
+
if ($object->parts_id) {
$entry->{info_data}->{partnumber} = $self->parts_by->{id}->{ $object->parts_id }->partnumber;
} else {