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