Sammelcommit Bankerweiterung und Skonto
[kivitendo-erp.git] / templates / webpages / bank_transactions / list.html
index d9d5238..0a38b2b 100644 (file)
@@ -6,7 +6,7 @@
 
 [%- INCLUDE 'common/flash.html' %]
 
-<p>[% 'Account number' | $T8 %] [% bank_account.account_number %], [% 'Bank code' | $T8 %] [% bank_account.bank_code %], [% 'Bank' | $T8 %] [% bank_account.bank %]</p>
+<p>[% HTML.escape(bank_account.name) %] [% HTML.escape(bank_account.iban) %], [% 'Bank code' | $T8 %] [% HTML.escape(bank_account.bank_code) %], [% 'Bank' | $T8 %] [% HTML.escape(bank_account.bank) %]</p>
 <p>
 [% IF FORM.filter.fromdate %] [% 'From' | $T8 %] [% FORM.filter.fromdate %] [% END %]
 [% IF FORM.filter.todate %]   [% 'to (date)' | $T8 %] [% FORM.filter.todate %][% END %]
@@ -69,7 +69,8 @@ function assign_invoice(bt_id) {
 }
 
 function add_invoices(bt_id, prop_id, prop_invnumber) {
-  //prop_id is a proposed invoice_id
+  // prop_id is a proposed invoice_id
+  // remove the added invoice from all the other suggestions
   var number_of_elements = document.getElementsByName(prop_id).length;
   for( var i = 0; i < number_of_elements; i++ ) {
     var node = document.getElementsByName(prop_id)[0];
@@ -77,11 +78,13 @@ function add_invoices(bt_id, prop_id, prop_invnumber) {
   }
   UnTip();
   var invoices = document.getElementById('assigned_invoices_' + bt_id);
-  var div_element = '<div id="' + bt_id + '.' + prop_id + '">';
-  var hidden_element = '<input type="hidden" name="invoice_ids.' + bt_id + '[]" value="' + prop_id + '">' + prop_invnumber;
-  var link_element   = '<a href=# onclick="delete_invoice(' + bt_id + ',' + prop_id + ');">x</a>';
-  var new_html = div_element + hidden_element + link_element + '</div>';
-  invoices.innerHTML += new_html;
+
+  $.ajax({
+    url: 'controller.pl?action=BankTransaction/ajax_payment_suggestion&bt_id=' + bt_id  + '&prop_id=' + prop_id,
+    success: function(data) {
+      invoices.innerHTML += data.html;
+    }
+  });
 }
 
 function delete_invoice(bt_id, prop_id) {