Revision fd840a7b
Von Bernd Bleßmann vor fast 8 Jahren hinzugefügt
SL/Controller/CsvImport/Order.pm | ||
---|---|---|
391 | 391 |
|
392 | 392 |
$self->handle_unit($entry); |
393 | 393 |
$self->handle_sellprice($entry); |
394 |
$self->handle_discount($entry); |
|
394 | 395 |
|
395 | 396 |
# copy from part if not given |
396 | 397 |
$object->description($part_obj->description) unless $object->description; |
... | ... | |
398 | 399 |
$object->lastcost($part_obj->lastcost) unless defined $object->lastcost; |
399 | 400 |
|
400 | 401 |
# set to 0 if not given |
401 |
$object->discount(0) unless $object->discount; |
|
402 | 402 |
$object->ship(0) unless $object->ship; |
403 | 403 |
|
404 | 404 |
$self->check_project($entry, global => 0); |
... | ... | |
448 | 448 |
} |
449 | 449 |
} |
450 | 450 |
|
451 |
sub handle_discount { |
|
452 |
my ($self, $entry) = @_; |
|
453 |
|
|
454 |
my $object = $entry->{object}; |
|
455 |
|
|
456 |
$object->discount($object->discount/100.0) if $object->discount; |
|
457 |
$object->discount(0) unless $object->discount; |
|
458 |
} |
|
459 |
|
|
451 | 460 |
sub check_part { |
452 | 461 |
my ($self, $entry) = @_; |
453 | 462 |
|
Auch abrufbar als: Unified diff
CsvImport Aufträge: Rabatt richtig für Datenbank aufbereiten.
In der DB steht der Rabatt als Hundertstel.