X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b98935252284591d5a1d95dda05974b14f4b2b4d..d59c544786c8f76756e2ec10dc3b8f803355efdc:/SL/Controller/Order.pm diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 469eb40f0..836351e4b 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -175,6 +175,7 @@ sub action_add_item { ->val('#add_item_discount_as_percent', '') ->run('row_table_scroll_down') ->run('row_set_keyboard_events_by_id', $item_id) + ->on('.recalc', 'change', 'recalc_amounts_and_taxes') ->focus('#add_item_parts_id_name'); $self->_js_redisplay_amounts_and_taxes; @@ -186,10 +187,19 @@ sub action_recalc_amounts_and_taxes { $self->_recalc(); + $self->_js_redisplay_linetotals; $self->_js_redisplay_amounts_and_taxes; $self->js->render($self); } +sub _js_redisplay_linetotals { + my ($self) = @_; + + my @data = map {$::form->format_amount(\%::myconfig, $_->{linetotal}, 2, 0)} @{ $self->order->items }; + $self->js + ->run('redisplay_linetotals', \@data); +} + sub _js_redisplay_amounts_and_taxes { my ($self) = @_;