From: Bernd Bleßmann Date: Fri, 18 Dec 2015 10:32:43 +0000 (+0100) Subject: Auftrags-Controller: Positions-Spalte anzeigen und renummerieren bei Änderungen. X-Git-Tag: release-3.4.1~335 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=59da90f65a7f714f03cc9f6f6b5149b4477c6de0;p=kivitendo-erp.git Auftrags-Controller: Positions-Spalte anzeigen und renummerieren bei Änderungen. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 8bebe381d..0f715189d 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -371,6 +371,7 @@ sub action_add_item { ->run('row_table_scroll_down') ->run('row_set_keyboard_events_by_id', $item_id) ->run('set_unit_change_with_oldval_by_id', $item_id) + ->run('renumber_positions') ->on('.recalc', 'change', 'recalc_amounts_and_taxes') ->on('.reformat_number', 'change', 'reformat_number') ->focus('#add_item_parts_id_name'); @@ -429,6 +430,7 @@ sub action_add_multi_items { $self->js ->run('close_multi_items_dialog') ->run('row_table_scroll_down') + ->run('renumber_positions') ->on('.recalc', 'change', 'recalc_amounts_and_taxes') ->on('.reformat_number', 'change', 'reformat_number') ->focus('#add_item_parts_id_name'); diff --git a/templates/webpages/order/tabs/_row.html b/templates/webpages/order/tabs/_row.html index 9ca6bbbf8..b15424c68 100644 --- a/templates/webpages/order/tabs/_row.html +++ b/templates/webpages/order/tabs/_row.html @@ -11,6 +11,11 @@ [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %] [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %] + +
+ [% HTML.escape(ITEM.position) %] +
+ [%- LxERP.t8('reorder item') %] diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index e49a1b7ef..0ee6bc863 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -154,6 +154,7 @@ + [%- 'position' | $T8 %] [%- LxERP.t8('reorder item') %] [%- LxERP.t8('delete item') %] [%- 'Partnumber' | $T8 %] @@ -334,6 +335,7 @@ function delete_order_item_row(clicked) { var row = $(clicked).parents("tbody").first(); $(row).remove(); + renumber_positions(); recalc_amounts_and_taxes(); } @@ -515,6 +517,12 @@ close_email_dialog = function() { email_dialog.dialog("close"); } +function renumber_positions() { + $('.row_entry [name="position"]').each(function(idx, elt) { + $(elt).html(idx+1); + }); +} + $(function(){ $('#order_[%- cv_id %]').change(reload_cv_dependend_selections); @@ -539,4 +547,7 @@ $(function(){ set_unit_change_with_oldval($('.unitselect')); }); +$('#row_table_id').on('sortstop', function(event, ui) { + renumber_positions(); +});