Zeiterfassung: Eingabe-Template: digest gibt es hier nicht
[kivitendo-erp.git] / templates / webpages / bank_transactions / assign_invoice.html
index f8a6697..1df0af2 100644 (file)
@@ -1,36 +1,38 @@
 [%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE T8 %]
 
-<form method="post" action="javascript:filter_invoices();">
-  <b>Transaction</b>
+[% SET debug = 0 %]
+
+<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">
-    <td>[%- LxERP.t8("ID") %]:</td>
+    [% IF debug %]<td>[%- LxERP.t8("ID") %]:</td>[% END %]
+    <td>[%- LxERP.t8("Transdate") %]:</td>
     <td>[%- LxERP.t8("Amount") %]:</td>
-    <td>[%- LxERP.t8("Remote bank code") %]:</td>
-    <td>[%- LxERP.t8("Remote account number") %]:</td>
     <td>[%- LxERP.t8("Remote name") %]:</td>
     <td>[%- LxERP.t8("Purpose") %]:</td>
-    <td>[%- LxERP.t8("Transdate") %]:</td>
+    <td>[%- LxERP.t8("Remote account number") %]:</td>
+    <td>[%- LxERP.t8("Remote bank code") %]:</td>
    </tr>
 
    <tr class="listrow">
-    <td>[% SELF.transaction.id %]</td>
+    [% IF debug %]<td>[% SELF.transaction.id %]</td>[% END %]
+    <td>[% SELF.transaction.transdate_as_date %]</td>
     <td>[% LxERP.format_amount(SELF.transaction.amount, 2) %]</td>
-    <td>[% SELF.transaction.remote_bank_code %]</td>
-    <td>[% SELF.transaction.remote_account_number %]</td>
     <td>[% SELF.transaction.remote_name %]</td>
     <td>[% SELF.transaction.purpose %]</td>
-    <td>[% SELF.transaction.transdate_as_date %]</td>
+    <td>[% SELF.transaction.remote_account_number %]</td>
+    <td>[% SELF.transaction.remote_bank_code %]</td>
    </tr>
   </table>
 
-  <b>Filter</b>
+  <b>[%- LxERP.t8("Invoice filter") %]:</b>
   <table>
    <tr>
     <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>
 
     <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>
 
    <tr>
-    <th align="right">[%- LxERP.t8("Transdate from") %]</th>
+    <th align="right">[%- LxERP.t8("Invdate from") %]</th>
     <td>[% L.date_tag('transdatefrom') %]</td>
 
     <th align="right">[%- LxERP.t8("to (date)") %]</th>
@@ -53,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>
-