Templates werden nicht mehr explizit übersetzt: *_master in * umbenannt
[kivitendo-erp.git] / templates / webpages / gl / form_header_chart_balances_js.html
diff --git a/templates/webpages/gl/form_header_chart_balances_js.html b/templates/webpages/gl/form_header_chart_balances_js.html
new file mode 100644 (file)
index 0000000..3263ee7
--- /dev/null
@@ -0,0 +1,28 @@
+[% USE HTML %]
+[% USE JavaScript %]
+[% USE LxERP %]
+
+<script type="text/javascript">
+ <!--
+var chart_balances = new Array();
+
+[% FOREACH chart = ALL_CHARTS %]
+chart_balances[[% loop.count - 1 %]] = '[% JavaScript.escape(LxERP.format_amount(chart.balance, 2, 0, 'DRCR')) %]';
+[%- END %]
+
+function show_chart_balance(obj) {
+  var row = $(obj).attr('name').replace(/.*_/, '');
+  var idx = $('#accno_' + row).attr('selectedIndex');
+  $('#chart_balance_' + row).html(chart_balances[idx]);
+}
+
+$(document).ready(function() {
+  [%- SET row=0 %]
+  [%- WHILE row < rowcount %]
+   [%- SET row=row + 1 %]
+   $('#accno_[% row %]').change(function() { show_chart_balance(this); });
+   show_chart_balance($('#accno_[% row %]'));
+  [%- END %]
+});
+-->
+</script>