Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / bank_transactions / assign_invoice.html
index 26229b8..1df0af2 100644 (file)
@@ -2,7 +2,7 @@
 
 [% SET debug = 0 %]
 
-<form method="post" action="javascript:filter_invoices();">
+<form method="post" action="javascript:kivi.BankTransaction.filter_invoices();" id="assign_invoice_window_form" data-bank-transaction-id="[% HTML.escape(SELF.transaction.id) %]">
   <b>[%- LxERP.t8("Bank transaction") %]:</b>
   <table>
    <tr class="listheading">
@@ -32,7 +32,7 @@
     <th align="right">[%- LxERP.t8("Invoice number") %]</th>
     <td>[% L.input_tag('invnumber', '', style=style) %]</td>
 
-    <th align="right">[%- LxERP.t8("Customer/Vendor name") %]</th>
+    <th align="right">[%- LxERP.t8("Customer/Vendor Name") %]</th>
     <td>[% L.input_tag('vcname', '', style=style) %]</td>
    </tr>
 
@@ -40,7 +40,7 @@
     <th align="right">[%- LxERP.t8("Amount") %]</th>
     <td>[% L.input_tag('amount', '', style=style) %]</td>
 
-    <th align="right">[%- LxERP.t8("Customer/Vendor number") %]</th>
+    <th align="right">[%- LxERP.t8("Customer/Vendor Number") %]</th>
     <td>[% L.input_tag('vcnumber', '', style=style) %]</td>
    </tr>
 
@@ -55,8 +55,8 @@
 
   <p>
    [% L.submit_tag('', LxERP.t8("Search")) %]
-   [% L.button_tag('add_selected_invoices()', LxERP.t8("Add invoices"), id='add_selected_record_links_button') %]
-   <a href="#" onclick="assign_invoice_reset_form();">[%- LxERP.t8("Reset") %]</a>
+   [% L.button_tag('kivi.BankTransaction.add_selected_invoices()', LxERP.t8("Add invoices"), id='add_selected_record_links_button') %]
+   [% L.button_tag('$("#assign_invoice_window_form").resetForm()', LxERP.t8('Reset')) %]
    <a href="#" onclick="$('#assign_invoice_window').dialog('close');">[% LxERP.t8("Cancel") %]</a>
   </p>
 
 
 <script type="text/javascript">
 <!--
-
-function filter_invoices() {
-  var url="controller.pl?action=BankTransaction/ajax_add_list&" + $("#assign_invoice_window form").serialize();
-  $.ajax({
-    url: url,
-    success: function(new_data) {
-      $("#record_list_filtered_list").html(new_data['html']);
-    }
-  });
-}
-
-function add_selected_invoices() {
-  var url="controller.pl?action=BankTransaction/ajax_accept_invoices&" + 'bt_id=[% SELF.transaction.id %]&' + $("#assign_invoice_window form").serialize();
-  $.ajax({
-    url: url,
-    success: function(new_html) {
-      var invoices = document.getElementById('assigned_invoices_[% SELF.transaction.id %]');
-      if (invoices.innerHTML == '') {
-        invoices.innerHTML = new_html;
-      } else {
-        invoices.innerHTML += '<br />' + new_html;
-      }
-      $('#assign_invoice_window').dialog('close');
-    }
-  });
-}
-
-function assign_invoice_reset_form() {
-  $('#assign_invoice_window form input[type=text]').val('');
-}
+$(function() {
+  $('#invnumber').focus();
+});
 
 //-->
 </script>
-