Revision 340b402a
Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
401 | 401 |
return unless $form_attr->{parts_id}; |
402 | 402 |
|
403 | 403 |
my $item = _new_item($self->order, $form_attr); |
404 |
|
|
404 | 405 |
$self->order->add_items($item); |
405 | 406 |
|
406 | 407 |
$self->_recalc(); |
... | ... | |
413 | 414 |
); |
414 | 415 |
|
415 | 416 |
$self->js |
416 |
->append('#row_table_id', $row_as_html) |
|
417 |
->append('#row_table_id', $row_as_html); |
|
418 |
|
|
419 |
if ( $item->part->is_assortment ) { |
|
420 |
$form_attr->{qty_as_number} = 1 unless $form_attr->{qty_as_number}; |
|
421 |
foreach my $assortment_item ( @{$item->part->assortment_items} ) { |
|
422 |
my $attr = { parts_id => $assortment_item->parts_id, |
|
423 |
qty => $assortment_item->qty * $::form->parse_amount(\%::myconfig, $form_attr->{qty_as_number}), # TODO $form_attr->{unit} |
|
424 |
unit => $assortment_item->unit, |
|
425 |
description => $assortment_item->part->description, |
|
426 |
}; |
|
427 |
my $item = _new_item($self->order, $attr); |
|
428 |
$self->order->add_items( $item ); |
|
429 |
$self->_recalc(); |
|
430 |
my $item_id = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000); |
|
431 |
my $row_as_html = $self->p->render('order/tabs/_row', |
|
432 |
ITEM => $item, |
|
433 |
ID => $item_id, |
|
434 |
ALL_PRICE_FACTORS => $self->all_price_factors |
|
435 |
); |
|
436 |
$self->js |
|
437 |
->append('#row_table_id', $row_as_html); |
|
438 |
}; |
|
439 |
}; |
|
440 |
|
|
441 |
$self->js |
|
417 | 442 |
->val('.add_item_input', '') |
418 | 443 |
->run('kivi.Order.init_row_handlers') |
419 | 444 |
->run('kivi.Order.row_table_scroll_down') |
Auch abrufbar als: Unified diff
Test: Im OrderController Sortimentsartikel auspacken