]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorPeter Schulgin <peter.schulgin@opendynamic.de>
Mon, 6 Jan 2014 10:34:52 +0000 (11:34 +0100)
committerPeter Schulgin <peter.schulgin@opendynamic.de>
Mon, 6 Jan 2014 10:34:52 +0000 (11:34 +0100)
templates/webpages/gl/form_header.html
templates/webpages/gl/update_tax_accounts.html

index ec175696d856e093e22aeee257c2d1db63fb0daa..98bb8f067e1b2d4386d2bc1ad3945e153d4d30bb 100644 (file)
@@ -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);
index 940d34dfed21588598bf5edf430c52470bd3d266..d3c9586b21114236b8db0591ea2adb7618f9a509 100644 (file)
@@ -1,3 +1,4 @@
+[% USE L %]
 [% FOR row = TAX_ACCOUNTS %]
-<option value='[% row.id %]--[% row.rate %]' [% IF row.id == select_index %]selected[% END %]>[% row.taxdescription %] %</option>
+<option value='[% row.id %]--[% row.rate %]'[% IF row.id == selected_tax_id%] selected[% END %]>[% row.taxdescription %] %</option>
 [% END %]