Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / bank_transactions / create_invoice.html
index cfc9ce8..2af7755 100644 (file)
@@ -1,6 +1,6 @@
-[%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE T8 %]
+[%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
 
-  <b>Transaction</b>
+  <b>[% LxERP.t8("Bank transaction") %]</b>
   <table>
    <tr class="listheading">
     <td>[%- LxERP.t8("ID") %]:</td>
 
 
 <br>
-[% 'Vendor filter for AP transaction drafts' | $T8 %]:
-
-<form method="post" action="javascript:filter_drafts();">
-[% L.hidden_tag('bt_id', SELF.transaction.id) %]
-  <table>
-   <tr>
-    <th align="right">[%- LxERP.t8("Vendor") %]</th>
-    <td>
-            [%- INCLUDE 'generic/multibox.html'
-                 name          = 'vendor',
-                 select_name   = 'vendor_id',
-                 default       = ALL_VENDORS.size < limit ? vendor_id : vendor_name,
-                 style         = 'width: 250px',
-                 DATA          = ALL_VENDORS,
-                 id_key        = 'id',
-                 label_key     = 'name',
-                 limit         = limit,
-                 show_empty    = 1,
-                 allow_textbox = 1,
-                 class         = 'initial_focus',
-                 onChange      = 'filter_drafts();',
-                 -%]
-    </td>
-   </tr>
-  </table>
-</form>
 
+<form method="post" action="javascript:kivi.BankTransaction.filter_templates()" id="create_invoice_window_form">
+ [% L.hidden_tag("bt_id",               SELF.transaction.id) %]
+ [% L.hidden_tag("filter.bank_account", FORM.filter.bank_account) %]
+ [% L.hidden_tag("filter.fromdate",     FORM.filter.fromdate) %]
+ [% L.hidden_tag("filter.todate",      FORM.filter.todate) %]
+ <table>
+  <tr>
+   <th align="right">[%- LxERP.t8("Template Description") %]</th>
+   <td>[% P.input_tag("template", template_name, style="width: 250px") %]</td>
+  </tr>
+  <tr>
+   <th align="right">[%- LxERP.t8("Vendor") %]</th>
+   <td>[% P.input_tag("vendor", vendor_name,  style="width: 250px") %]</td>
+  </tr>
+  <tr>
+   <th align="right">[%- LxERP.t8("Reference") %]</th>
+   <td>[% P.input_tag("reference", reference_name, style="width: 250px") %]</td>
+  </tr>
+ </table>
   <p>
+   [% P.submit_tag('', LxERP.t8("Filter")) %]
+   [% P.button_tag('$("#create_invoice_window_form").resetForm()', LxERP.t8('Reset')) %]
    <a href="#" onclick="$('#create_invoice_window').dialog('close');">[% LxERP.t8("Cancel") %]</a>
   </p>
-
+</form>
   <hr>
-<div id="drafts">
-[% IF DRAFTS.size %]
-[% 'Draft suggestions' | $T8 %]:
-
-
-  <table>
-   <tr>
-    <th class="listheading">[% 'Description' | $T8 %]</th>
-    <th class="listheading">[% 'Vendor' | $T8 %]</th>
-    <th class="listheading">[% 'Employee' | $T8 %]</th>
-    <th class="listheading">[% 'Draft from:' | $T8 %]</th>
-   </tr>
-
-   [% FOREACH draft = DRAFTS %]
-    <tr class="listrow[% loop.count % 2 %]">
-     <td><a href="[% draft.module %].pl?action=load_draft&id=[% HTML.url(draft.id) %]&amount_1=[% LxERP.format_amount(-1 * SELF.transaction.amount, 2) %]&transdate=[% HTML.url(SELF.transaction.transdate_as_date) %]&duedate=[% HTML.url(SELF.transaction.transdate_as_date) %]&datepaid_1=[% HTML.url(SELF.transaction.transdate_as_date) %]&paid_1=[% LxERP.format_amount(-1 * SELF.transaction.amount, 2) %]&currency=[% HTML.url(SELF.transaction.currency.name) %]&AP_paid_1=[% HTML.url(SELF.transaction.local_bank_account.chart.accno) %]&remove_draft=0&callback=[% HTML.url(callback) %]">[% HTML.escape(draft.description) %]</a></td>
-     <td>[% HTML.escape(draft.vendor) %]</td>
-     <td>[% HTML.escape(draft.employee.name) %]</td>
-     <td>[% HTML.escape(draft.itime_as_date) %]</td>
-    </tr>
-   [% END %]
-  </table>
-[% ELSE %]
-  <p class="message_hint">[% 'No draft was found.' | $T8 %]</p>
-[% END %]
+<div id="templates">
+ [% PROCESS "bank_transactions/_template_list.html" %]
 </div>
 
 <script type="text/javascript">
 <!--
+$(function() {
+  $('#template').focus();
+});
 
-function filter_drafts() {
-  var url="controller.pl?action=BankTransaction/filter_drafts&" + $("#create_invoice_window form").serialize();
-  $.ajax({
-    url: url,
-    success: function(new_data) {
-      $("#drafts").html(new_data['html']);
-    }
-  });
-}
 //-->
 </script>
-