X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/8fdb9983021ac73551052681d3a9d69514447a58..aa2d928e4f13b7f730b68c947d5b8211abd9f0e4:/js/kivi.Part.js diff --git a/js/kivi.Part.js b/js/kivi.Part.js index 9fa071839..4f813bbf4 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -334,14 +334,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(','); @@ -351,6 +355,15 @@ namespace('kivi.Part', function(ns) { if (this.o.convertible_unit) data['filter.unit_obj.convertible_to'] = this.o.convertible_unit; + var filter_name = 'all'; + if (this.o.with_makemodel) { + filter_name = 'all_with_makemodel'; + } + if (this.o.with_customer_partnumber) { + filter_name = 'all_with_customer_partnumber'; + } + data['filter.' + filter_name + ':substr:multi::ilike'] = term; + return data; }, set_item: function(item) { @@ -682,6 +695,11 @@ namespace('kivi.Part', function(ns) { var self = this; var data = $('#multi_items_form').serializeArray(); data.push({ name: 'type', value: self.pp.type }); + var ppdata = self.pp.ajax_data(function(){ + var val = $('#multi_items_filter').val(); + return val === undefined ? '' : val + }); + $.each(Object.keys(ppdata), function() {data.push({ name: 'multi_items.' + this, value: ppdata[this]});}); $.ajax({ url: 'controller.pl?action=Part/multi_items_update_result', data: data,