Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / js / kivi.GL.js
diff --git a/js/kivi.GL.js b/js/kivi.GL.js
new file mode 100644 (file)
index 0000000..dc17ff3
--- /dev/null
@@ -0,0 +1,35 @@
+namespace('kivi.GL', function(ns) {
+  "use strict";
+
+  this.show_chart_balance = function(obj) {
+    var row = $(obj).attr('name').replace(/.*_/, '');
+
+    $.ajax({
+      url: 'gl.pl?action=get_chart_balance',
+      data: { accno_id:  $(obj).val() },
+      dataType: 'html',
+      success: function (new_html) {
+        $('#chart_balance_' + row).html(new_html);
+      }
+    });
+  };
+
+  this.update_taxes = function(obj) {
+    var row = $(obj).attr('name').replace(/.*_/, '');
+
+    $.ajax({
+      url: 'gl.pl?action=get_tax_dropdown',
+      data: { accno_id:     $(obj).val(),
+              transdate:    $('#transdate').val(),
+              deliverydate: $('#deliverydate').val() },
+      dataType: 'html',
+      success: function (new_html) {
+        $("#taxchart_" + row).html(new_html);
+      }
+    });
+  };
+});
+
+$(function() {
+  kivi.File.doc_tab_init('gl_tabs', 'ui-tabs-docs', $('#id').val(), 'gl_transaction');
+});