Revision fc903ee0
Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
425 | 425 |
description => $assortment_item->part->description, |
426 | 426 |
}; |
427 | 427 |
my $item = _new_item($self->order, $attr); |
428 |
|
|
429 |
# set discount to 100% if item isn't supposed to be charged, overwriting any customer discount |
|
430 |
$item->discount(1) unless $assortment_item->charge; |
|
431 |
|
|
428 | 432 |
$self->order->add_items( $item ); |
429 | 433 |
$self->_recalc(); |
430 | 434 |
my $item_id = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000); |
... | ... | |
486 | 490 |
|
487 | 491 |
my @items; |
488 | 492 |
foreach my $attr (@form_attr) { |
489 |
push @items, _new_item($self->order, $attr); |
|
493 |
my $item = _new_item($self->order, $attr); |
|
494 |
push @items, $item; |
|
495 |
if ( $item->part->is_assortment ) { |
|
496 |
foreach my $assortment_item ( @{$item->part->assortment_items} ) { |
|
497 |
my $attr = { parts_id => $assortment_item->parts_id, |
|
498 |
qty => $assortment_item->qty * $item->qty, # TODO $form_attr->{unit} |
|
499 |
unit => $assortment_item->unit, |
|
500 |
description => $assortment_item->part->description, |
|
501 |
}; |
|
502 |
my $item = _new_item($self->order, $attr); |
|
503 |
|
|
504 |
# set discount to 100% if item isn't supposed to be charged, overwriting any customer discount |
|
505 |
$item->discount(1) unless $assortment_item->charge; |
|
506 |
push @items, $assortment_item; |
|
507 |
} |
|
508 |
} |
|
490 | 509 |
} |
491 | 510 |
$self->order->add_items(@items); |
492 | 511 |
|
Auch abrufbar als: Unified diff
Order Controller - Sortimente hinzufügen + charge