X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Fgl%2Fform_header.html;h=98bb8f067e1b2d4386d2bc1ad3945e153d4d30bb;hb=efb9a24f2252104ab4af5c25334119d7c5c70a8c;hp=ec175696d856e093e22aeee257c2d1db63fb0daa;hpb=0f0cb3b708f9078b774a07cecd996e5bdc5fac63;p=kivitendo-erp.git diff --git a/templates/webpages/gl/form_header.html b/templates/webpages/gl/form_header.html index ec175696d..98bb8f067 100644 --- a/templates/webpages/gl/form_header.html +++ b/templates/webpages/gl/form_header.html @@ -8,18 +8,15 @@ 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]; $.ajax({ url: 'gl.pl?action=get_tax_dropdown', data: { accno: account, - selected_index: index}, + selected_tax_id: default_tax_id}, dataType: 'html', success: function (new_html) { $("#taxchart_" + row).html(new_html);