]> wagnertech.de Git - mfinanz.git/blobdiff - js/kivi.BankTransaction.js
Kontoauszug verbuchen: Neuen Skonto-Typ
[mfinanz.git] / js / kivi.BankTransaction.js
index 838b98aff3b3234f78befe4b7e65f36fa7ec50e5..a0a0f0fe4c9479e5dbb1f0a250d5c6e0bdc945f7 100644 (file)
@@ -44,7 +44,7 @@ namespace('kivi.BankTransaction', function(ns) {
   ns.create_invoice = function(bank_transaction_id) {
     kivi.popup_dialog({
       url:    'controller.pl?action=BankTransaction/create_invoice',
-      data:   '&bt_id=' + bank_transaction_id + "&filter.bank_account=" + $('#filter_bankaccount').val() + '&filter.fromdate=' + $('#filter_fromdate').val() + '&filter.todate=' + $('#filter_todate').val(),
+      data:   '&bt_id=' + bank_transaction_id + "&filter.bank_account=" + $('#filter_bank_account').val() + '&filter.fromdate=' + $('#filter_fromdate').val() + '&filter.todate=' + $('#filter_todate').val(),
       type:   'POST',
       id:     'create_invoice_window',
       dialog: { title: kivi.t8('Create invoice') }
@@ -130,4 +130,30 @@ namespace('kivi.BankTransaction', function(ns) {
 
     $dlg.dialog('close');
   };
+
+  ns.filter_templates = function() {
+    var url="controller.pl?action=BankTransaction/filter_templates&" + $("#create_invoice_window form").serialize();
+    $.ajax({
+      url: url,
+      success: function(new_data) {
+        $("#templates").html(new_data.error || new_data.html);
+      }
+    });
+  };
+  ns.update_skonto = function(caller, bt_id, prop_id, formatted_amount_with_skonto_pt) {
+    if (caller.value === 'free_skonto') {
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).val("");
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).prop('disabled', false);
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).focus();
+    }
+    if (caller.value === 'without_skonto') {
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).val(kivi.format_amount(0,2));
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).prop('disabled', true);
+    }
+    if (caller.value === 'with_skonto_pt') {
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).val(formatted_amount_with_skonto_pt);
+      $('#free_skonto_amount_' + bt_id + '_' + prop_id).prop('disabled', true);
+    }
+  };
+
 });