X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/974e8264c338823486ae5d4fcece5c4712e66833..afdd12edf409d02d0088e01fc7a756d88043eb4e:/js/kivi.Part.js diff --git a/js/kivi.Part.js b/js/kivi.Part.js index bf35cb874..0b0185bf3 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -245,6 +245,7 @@ namespace('kivi.Part', function(ns) { var data = $('#makemodel_table :input').serializeArray(); data.push({ name: 'action', value: 'Part/add_makemodel_row' }); + $('#add_makemodel').data('customer_vendor_picker').clear(); $.post("controller.pl", data, kivi.eval_json_result); }; @@ -269,10 +270,11 @@ namespace('kivi.Part', function(ns) { }; ns.add_customerprice_row = function() { - if ($('#add_customerpriceid').val() === '') return; + if ($('#add_customerprice').val() === '') return; var data = $('#customerprice_table :input').serializeArray(); data.push({ name: 'action', value: 'Part/add_customerprice_row' }); + $('#add_customerprice').data('customer_vendor_picker').clear(); $.post("controller.pl", data, kivi.eval_json_result); }; @@ -333,13 +335,18 @@ namespace('kivi.Part', function(ns) { ajax_data: function(term) { var data = { 'filter.all:substr:multi::ilike': term, - 'filter.obsolete': 0, current: this.$real.val(), }; if (this.o.part_type) data['filter.part_type'] = this.o.part_type.split(','); + if (this.o.status) { + if (this.o.status == 'active') data['filter.obsolete'] = 0; + if (this.o.status == 'obsolete') data['filter.obsolete'] = 1; + } else + data['filter.obsolete'] = 0; + if (this.o.classification_id) data['filter.classification_id'] = this.o.classification_id.split(','); @@ -494,6 +501,9 @@ namespace('kivi.Part', function(ns) { }, select: function(event, ui) { self.set_item(ui.item); + if (self.o.action.commit_one) { + self.run_action(self.o.action.commit_one); + } }, search: function(event, ui) { if ((event.which == KEY.SHIFT) || (event.which == KEY.CTRL) || (event.which == KEY.ALT)) @@ -744,6 +754,14 @@ namespace('kivi.Part', function(ns) { if (!$(elt).data('part_picker')) $(elt).data('part_picker', new kivi.Part.Picker($(elt))); }); + + kivi.run_once_for('#customerprice_rows', 'customerprice_row_sort_renumber', function(elt) { + $(elt).on('sortstop', kivi.Part.customerprice_renumber_positions); + }); + + kivi.run_once_for('#makemodel_rows', 'makemodel_row_sort_renumber', function(elt) { + $(elt).on('sortstop', kivi.Part.makemodel_renumber_positions); + }); } ns.init = function() {