26229b8cc97ea6e91c72494496714da8821b364f
[kivitendo-erp.git] / templates / webpages / bank_transactions / assign_invoice.html
1 [%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE T8 %]
2
3 [% SET debug = 0 %]
4
5 <form method="post" action="javascript:filter_invoices();">
6   <b>[%- LxERP.t8("Bank transaction") %]:</b>
7   <table>
8    <tr class="listheading">
9     [% IF debug %]<td>[%- LxERP.t8("ID") %]:</td>[% END %]
10     <td>[%- LxERP.t8("Transdate") %]:</td>
11     <td>[%- LxERP.t8("Amount") %]:</td>
12     <td>[%- LxERP.t8("Remote name") %]:</td>
13     <td>[%- LxERP.t8("Purpose") %]:</td>
14     <td>[%- LxERP.t8("Remote account number") %]:</td>
15     <td>[%- LxERP.t8("Remote bank code") %]:</td>
16    </tr>
17
18    <tr class="listrow">
19     [% IF debug %]<td>[% SELF.transaction.id %]</td>[% END %]
20     <td>[% SELF.transaction.transdate_as_date %]</td>
21     <td>[% LxERP.format_amount(SELF.transaction.amount, 2) %]</td>
22     <td>[% SELF.transaction.remote_name %]</td>
23     <td>[% SELF.transaction.purpose %]</td>
24     <td>[% SELF.transaction.remote_account_number %]</td>
25     <td>[% SELF.transaction.remote_bank_code %]</td>
26    </tr>
27   </table>
28
29   <b>[%- LxERP.t8("Invoice filter") %]:</b>
30   <table>
31    <tr>
32     <th align="right">[%- LxERP.t8("Invoice number") %]</th>
33     <td>[% L.input_tag('invnumber', '', style=style) %]</td>
34
35     <th align="right">[%- LxERP.t8("Customer/Vendor name") %]</th>
36     <td>[% L.input_tag('vcname', '', style=style) %]</td>
37    </tr>
38
39    <tr>
40     <th align="right">[%- LxERP.t8("Amount") %]</th>
41     <td>[% L.input_tag('amount', '', style=style) %]</td>
42
43     <th align="right">[%- LxERP.t8("Customer/Vendor number") %]</th>
44     <td>[% L.input_tag('vcnumber', '', style=style) %]</td>
45    </tr>
46
47    <tr>
48     <th align="right">[%- LxERP.t8("Invdate from") %]</th>
49     <td>[% L.date_tag('transdatefrom') %]</td>
50
51     <th align="right">[%- LxERP.t8("to (date)") %]</th>
52     <td>[% L.date_tag('transdateto') %]</td>
53    </tr>
54   </table>
55
56   <p>
57    [% L.submit_tag('', LxERP.t8("Search")) %]
58    [% L.button_tag('add_selected_invoices()', LxERP.t8("Add invoices"), id='add_selected_record_links_button') %]
59    <a href="#" onclick="assign_invoice_reset_form();">[%- LxERP.t8("Reset") %]</a>
60    <a href="#" onclick="$('#assign_invoice_window').dialog('close');">[% LxERP.t8("Cancel") %]</a>
61   </p>
62
63   <hr>
64
65   <div id="record_list_filtered_list"></div>
66
67 </form>
68
69 <script type="text/javascript">
70 <!--
71
72 function filter_invoices() {
73   var url="controller.pl?action=BankTransaction/ajax_add_list&" + $("#assign_invoice_window form").serialize();
74   $.ajax({
75     url: url,
76     success: function(new_data) {
77       $("#record_list_filtered_list").html(new_data['html']);
78     }
79   });
80 }
81
82 function add_selected_invoices() {
83   var url="controller.pl?action=BankTransaction/ajax_accept_invoices&" + 'bt_id=[% SELF.transaction.id %]&' + $("#assign_invoice_window form").serialize();
84   $.ajax({
85     url: url,
86     success: function(new_html) {
87       var invoices = document.getElementById('assigned_invoices_[% SELF.transaction.id %]');
88       if (invoices.innerHTML == '') {
89         invoices.innerHTML = new_html;
90       } else {
91         invoices.innerHTML += '<br />' + new_html;
92       }
93       $('#assign_invoice_window').dialog('close');
94     }
95   });
96 }
97
98 function assign_invoice_reset_form() {
99   $('#assign_invoice_window form input[type=text]').val('');
100 }
101
102 //-->
103 </script>
104