Revision 2d50590b
Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
329 | 329 |
$self->js->render(); |
330 | 330 |
} |
331 | 331 |
|
332 |
sub action_unit_changed { |
|
333 |
my ($self) = @_; |
|
334 |
|
|
335 |
my $idx = first_index { $_ eq $::form->{item_id} } @{ $::form->{orderitem_ids} }; |
|
336 |
my $item = $self->order->items->[$idx]; |
|
337 |
|
|
338 |
my $old_unit_obj = SL::DB::Unit->new(name => $::form->{old_unit})->load; |
|
339 |
$item->sellprice($item->unit_obj->convert_to($item->sellprice, $old_unit_obj)); |
|
340 |
|
|
341 |
$self->_recalc(); |
|
342 |
|
|
343 |
$self->js |
|
344 |
->run('update_sellprice', $::form->{item_id}, $item->sellprice_as_number); |
|
345 |
$self->_js_redisplay_linetotals; |
|
346 |
$self->_js_redisplay_amounts_and_taxes; |
|
347 |
$self->js->render(); |
|
348 |
} |
|
349 |
|
|
332 | 350 |
sub action_add_item { |
333 | 351 |
my ($self) = @_; |
334 | 352 |
|
... | ... | |
349 | 367 |
->val('.add_item_input', '') |
350 | 368 |
->run('row_table_scroll_down') |
351 | 369 |
->run('row_set_keyboard_events_by_id', $item_id) |
370 |
->run('set_unit_change_with_oldval_by_id', $item_id) |
|
352 | 371 |
->on('.recalc', 'change', 'recalc_amounts_and_taxes') |
353 | 372 |
->on('.reformat_number', 'change', 'reformat_number') |
354 | 373 |
->focus('#add_item_parts_id_name'); |
... | ... | |
400 | 419 |
|
401 | 420 |
$self->js |
402 | 421 |
->append('#row_table_id', $row_as_html) |
403 |
->run('row_set_keyboard_events_by_id', $item_id); |
|
422 |
->run('row_set_keyboard_events_by_id', $item_id) |
|
423 |
->run('set_unit_change_with_oldval_by_id', $item_id); |
|
404 | 424 |
} |
405 | 425 |
|
406 | 426 |
$self->js |
Auch abrufbar als: Unified diff
Auftrags-Controller: Einheiten per Select ändern können und sellprice anpassen.