X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=templates%2Fwebpages%2Fgl%2Fform_header.html;h=98bb8f067e1b2d4386d2bc1ad3945e153d4d30bb;hb=9bf9acdff05a8047d0561c68cdd93b0a03deb568;hp=d73380e3d1149f2d724a20129103782edf8b5f43;hpb=a23454bb1b039a31b7f77710ff663fa9152d530c;p=kivitendo-erp.git diff --git a/templates/webpages/gl/form_header.html b/templates/webpages/gl/form_header.html index d73380e3d..98bb8f067 100644 --- a/templates/webpages/gl/form_header.html +++ b/templates/webpages/gl/form_header.html @@ -8,33 +8,20 @@ function updateTaxes(row) { var accno = document.getElementById('accno_' + row); var taxkey = accno.options[accno.selectedIndex].value; - var reg = /--([0-9]*)/; + var reg = /^(.*?)--(\d*)$/; var found = reg.exec(taxkey); - var index = found[1]; - index = parseInt(index); - var tax = 'taxchart_' + row; - var taxkeyposition = taxkey.lastIndexOf(found[0]); - var account = taxkey.substr(0, taxkeyposition); + var account = found[1]; + var default_tax_id = found[2]; - var xmlhttp; - if (window.XMLHttpRequest) - {// code for IE7+, Firefox, Chrome, Opera, Safari - xmlhttp=new XMLHttpRequest(); - } - else - {// code for IE6, IE5 - xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); - } - xmlhttp.onreadystatechange=function() - { - if (xmlhttp.readyState==4 && xmlhttp.status==200) - { - var element = document.getElementById("taxchart_" + row); - element.innerHTML = xmlhttp.responseText; - } - } - xmlhttp.open("GET","gl.pl?action=get_tax_dropdown&accno=" + account + "&select_index=" + index,true); - xmlhttp.send(); + $.ajax({ + url: 'gl.pl?action=get_tax_dropdown', + data: { accno: account, + selected_tax_id: default_tax_id}, + dataType: 'html', + success: function (new_html) { + $("#taxchart_" + row).html(new_html); + }, + }); }; function copy_debit_to_credit() {