X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7e7aae8d20f3faf45073e5b888989a0ee5fce146..c75c19ad8a87dfb139b8fadd6eb6f2020820a83f:/js/kivi.CustomerVendor.js diff --git a/js/kivi.CustomerVendor.js b/js/kivi.CustomerVendor.js index 14e02e0d1..2bef3a771 100644 --- a/js/kivi.CustomerVendor.js +++ b/js/kivi.CustomerVendor.js @@ -58,7 +58,7 @@ namespace('kivi.CustomerVendor', function(ns) { this.selectContact = function(params) { var contactId = $('#contact_cp_id').val(); - var url = 'controller.pl?action=CustomerVendor/ajaj_get_contact&id='+ $('#cv_id').val() +'&db='+ $('#db').val() +'&contact_id='+ contactId; + var url = 'controller.pl?action=CustomerVendor/ajaj_get_contact&id='+ $('#cv_id').val() +'&db='+ $('#db').val() +'&contact_id='+ contactId; $.getJSON(url, function(data) { var contact = data.contact; @@ -71,7 +71,10 @@ namespace('kivi.CustomerVendor', function(ns) { $('#action_delete_contact').show(); else $('#action_delete_contact').hide(); - + if (data.contact.disable_cp_main === 1) + $("#contact_cp_main").prop("disabled", true); + else + $("#contact_cp_main").prop("disabled", false); if ( params.onFormSet ) params.onFormSet(); }); @@ -208,6 +211,7 @@ namespace('kivi.CustomerVendor', function(ns) { }; this.inline_report = function(target, source, data){ +// alert("HALLO S " + source + " --T " + target + " tt D " + data); $.ajax({ url: source, success: function (rsp) { @@ -271,7 +275,7 @@ namespace('kivi.CustomerVendor', function(ns) { 'filter.all:substr:multi::ilike': term, 'filter.obsolete': 0, current: this.$real.val(), - type: this.o.type, + type: this.o.cv_type, }; }, set_item: function(item) { @@ -364,6 +368,7 @@ namespace('kivi.CustomerVendor', function(ns) { self.handle_changed_text(); } if (event.which == KEY.ENTER) { + event.preventDefault(); self.handle_changed_text({ match_none: self.o.action.commit_none, match_one: self.o.action.commit_one, @@ -394,6 +399,9 @@ namespace('kivi.CustomerVendor', 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))