X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/59da90f65a7f714f03cc9f6f6b5149b4477c6de0..e8889e47af38072dc6fcbb4d97e2fdcc30d948d7:/templates/webpages/order/tabs/basic_data.html diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 0ee6bc863..102d5ed83 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -157,14 +157,14 @@ [%- 'position' | $T8 %] [%- LxERP.t8('reorder item') %] [%- LxERP.t8('delete item') %] - [%- 'Partnumber' | $T8 %] - [%- 'Description' | $T8 %] - [%- 'Qty' | $T8 %] + [%- 'Partnumber' | $T8 %] + [%- 'Description' | $T8 %] + [%- 'Qty' | $T8 %] [%- 'Price Factor' | $T8 %] [%- 'Unit' | $T8 %] [%- 'Price Source' | $T8 %] - [%- 'Price' | $T8 %] - [%- 'Discount' | $T8 %] + [%- 'Price' | $T8 %] + [%- 'Discount' | $T8 %] [%- 'Extended' | $T8 %] @@ -303,6 +303,8 @@ function add_item() { if ($('#add_item_parts_id').val() == '') return; if (!check_cv()) return; + $('#row_table_id thead a img').remove(); + var data = $('#order_form').serialize(); data += '&action=Order/add_item'; @@ -312,6 +314,8 @@ function add_item() { function show_multi_items_dialog() { if (!check_cv()) return; + $('#row_table_id thead a img').remove(); + kivi.popup_dialog({ url: 'controller.pl?action=Order/show_multi_items_dialog', data: { type: $('#type').val(), @@ -523,6 +527,38 @@ function renumber_positions() { }); } +function reorder_items(order_by) { + var dir = $('#' + order_by + '_header_id a img').attr("data-sort-dir"); + $('#row_table_id thead a img').remove(); + + var src; + if (dir == "1") { + dir = "0"; + src = "image/up.png"; + } else { + dir = "1"; + src = "image/down.png"; + }; + + $('#' + order_by + '_header_id a').append('[%- LxERP.t8('sort items') %]'); + + var data = $('#order_form').serialize(); + data += '&action=Order/reorder_items'; + data += '&order_by=' + order_by; + data += '&sort_dir=' + dir; + + $.post("controller.pl", data, kivi.eval_json_result); +} + +function redisplay_items(data) { + var old_rows = $('.row_entry').detach(); + var new_rows = []; + $(data).each(function(idx, elt) { + new_rows.push(old_rows[elt.old_pos - 1]); + }); + $(new_rows).appendTo($('#row_table_id')); + renumber_positions(); +} $(function(){ $('#order_[%- cv_id %]').change(reload_cv_dependend_selections); @@ -548,6 +584,7 @@ $(function(){ }); $('#row_table_id').on('sortstop', function(event, ui) { + $('#row_table_id thead a img').remove(); renumber_positions(); });