157 |
157 |
<th class="listheading" nowrap width="3" >[%- 'position' | $T8 %] </th>
|
158 |
158 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
|
159 |
159 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
|
160 |
|
<th class="listheading" nowrap width="15">[%- 'Partnumber' | $T8 %] </th>
|
161 |
|
<th class="listheading" nowrap >[%- 'Description' | $T8 %] </th>
|
162 |
|
<th class="listheading" nowrap width="5" >[%- 'Qty' | $T8 %] </th>
|
|
160 |
<th id="partnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:reorder_items("partnumber")'> [%- 'Partnumber' | $T8 %]</a></th>
|
|
161 |
<th id="description_header_id" class="listheading" nowrap ><a href='#' onClick='javascript:reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
|
|
162 |
<th id="qty_header_id" class="listheading" nowrap width="5" ><a href='#' onClick='javascript:reorder_items("qty")'> [%- 'Qty' | $T8 %]</a></th>
|
163 |
163 |
<th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
|
164 |
164 |
<th class="listheading" nowrap width="5" >[%- 'Unit' | $T8 %] </th>
|
165 |
165 |
<th class="listheading" nowrap width="5" >[%- 'Price Source' | $T8 %] </th>
|
166 |
|
<th class="listheading" nowrap width="15">[%- 'Price' | $T8 %] </th>
|
167 |
|
<th class="listheading" nowrap width="5" >[%- 'Discount' | $T8 %] </th>
|
|
166 |
<th id="sellprice_header_id" class="listheading" nowrap width="15" ><a href='#' onClick='javascript:reorder_items("sellprice")'> [%- 'Price' | $T8 %]</a></th>
|
|
167 |
<th id="discount_header_id" class="listheading" nowrap width="15" ><a href='#' onClick='javascript:reorder_items("discount")'> [%- 'Discount' | $T8 %]</a></th>
|
168 |
168 |
<th class="listheading" nowrap width="10">[%- 'Extended' | $T8 %] </th>
|
169 |
169 |
</tr>
|
170 |
170 |
</thead>
|
... | ... | |
303 |
303 |
if ($('#add_item_parts_id').val() == '') return;
|
304 |
304 |
if (!check_cv()) return;
|
305 |
305 |
|
|
306 |
$('#row_table_id thead a img').remove();
|
|
307 |
|
306 |
308 |
var data = $('#order_form').serialize();
|
307 |
309 |
data += '&action=Order/add_item';
|
308 |
310 |
|
... | ... | |
312 |
314 |
function show_multi_items_dialog() {
|
313 |
315 |
if (!check_cv()) return;
|
314 |
316 |
|
|
317 |
$('#row_table_id thead a img').remove();
|
|
318 |
|
315 |
319 |
kivi.popup_dialog({
|
316 |
320 |
url: 'controller.pl?action=Order/show_multi_items_dialog',
|
317 |
321 |
data: { type: $('#type').val(),
|
... | ... | |
523 |
527 |
});
|
524 |
528 |
}
|
525 |
529 |
|
|
530 |
function reorder_items(order_by) {
|
|
531 |
var dir = $('#' + order_by + '_header_id a img').attr("data-sort-dir");
|
|
532 |
$('#row_table_id thead a img').remove();
|
|
533 |
|
|
534 |
var src;
|
|
535 |
if (dir == "1") {
|
|
536 |
dir = "0";
|
|
537 |
src = "image/up.png";
|
|
538 |
} else {
|
|
539 |
dir = "1";
|
|
540 |
src = "image/down.png";
|
|
541 |
};
|
|
542 |
|
|
543 |
$('#' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="[%- LxERP.t8('sort items') %]">');
|
|
544 |
|
|
545 |
var data = $('#order_form').serialize();
|
|
546 |
data += '&action=Order/reorder_items';
|
|
547 |
data += '&order_by=' + order_by;
|
|
548 |
data += '&sort_dir=' + dir;
|
|
549 |
|
|
550 |
$.post("controller.pl", data, kivi.eval_json_result);
|
|
551 |
}
|
|
552 |
|
|
553 |
function redisplay_items(data) {
|
|
554 |
var old_rows = $('.row_entry').detach();
|
|
555 |
var new_rows = [];
|
|
556 |
$(data).each(function(idx, elt) {
|
|
557 |
new_rows.push(old_rows[elt.old_pos - 1]);
|
|
558 |
});
|
|
559 |
$(new_rows).appendTo($('#row_table_id'));
|
|
560 |
renumber_positions();
|
|
561 |
}
|
526 |
562 |
|
527 |
563 |
$(function(){
|
528 |
564 |
$('#order_[%- cv_id %]').change(reload_cv_dependend_selections);
|
... | ... | |
548 |
584 |
});
|
549 |
585 |
|
550 |
586 |
$('#row_table_id').on('sortstop', function(event, ui) {
|
|
587 |
$('#row_table_id thead a img').remove();
|
551 |
588 |
renumber_positions();
|
552 |
589 |
});
|
553 |
590 |
</script>
|
Auftrags-Controller: Sortieren der Positionen