From: Bernd Bleßmann Date: Mon, 7 Mar 2016 15:41:13 +0000 (+0100) Subject: Auftrags-Controller: css-Klasse: reformat_number zum Neuformatieren von Zahlen X-Git-Tag: release-3.4.1~346 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7c61f5b1fb8b15dcc41c39ec84d9887b3b4f14ac;p=kivitendo-erp.git Auftrags-Controller: css-Klasse: reformat_number zum Neuformatieren von Zahlen --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 858ff0021..1c713a72a 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -347,6 +347,7 @@ sub action_add_item { ->run('row_table_scroll_down') ->run('row_set_keyboard_events_by_id', $item_id) ->on('.recalc', 'change', 'recalc_amounts_and_taxes') + ->on('.reformat_number', 'change', 'reformat_number') ->focus('#add_item_parts_id_name'); $self->_js_redisplay_amounts_and_taxes; diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 41589d7f4..8574424e7 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -272,6 +272,10 @@ function delete_order_item_row(clicked) { recalc_amounts_and_taxes(); } +function reformat_number(event) { + $(event.target).val(kivi.format_amount(kivi.parse_amount($(event.target).val()), -2)); +} + function recalc_amounts_and_taxes() { var data = $('#order_form').serialize(); data += '&action=Order/recalc_amounts_and_taxes'; @@ -364,6 +368,7 @@ $(function(){ }); row_set_keyboard_events($('.row_entry')); $('.recalc').change(recalc_amounts_and_taxes); + $('.reformat_number').change(reformat_number); });