Merge branch 'bankerweiterung_und_skonto'
[kivitendo-erp.git] / templates / webpages / bank_transactions / create_invoice.html
1 [%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE T8 %]
2
3   <b>Transaction</b>
4   <table>
5    <tr class="listheading">
6     <td>[%- LxERP.t8("ID") %]:</td>
7     <td>[%- LxERP.t8("Amount") %]:</td>
8     <td>[%- LxERP.t8("Date") %]:</td>
9     <td>[%- LxERP.t8("Remote name") %]:</td>
10     <td>[%- LxERP.t8("Purpose") %]:</td>
11     <td>[%- LxERP.t8("Remote bank code") %]:</td>
12     <td>[%- LxERP.t8("Remote account number") %]:</td>
13    </tr>
14
15    <tr class="listrow">
16     <td>[% SELF.transaction.id %]</td>
17     <td>[% LxERP.format_amount(SELF.transaction.amount, 2) %]</td>
18     <td>[% SELF.transaction.valutadate_as_date %]</td>
19     <td>[% SELF.transaction.remote_name %]</td>
20     <td>[% SELF.transaction.purpose %]</td>
21     <td>[% SELF.transaction.remote_bank_code %]</td>
22     <td>[% SELF.transaction.remote_account_number %]</td>
23    </tr>
24   </table>
25
26
27 <br>
28 [% 'Vendor filter for AP transaction drafts' | $T8 %]:
29
30 <form method="post" action="javascript:filter_drafts();">
31 [% L.hidden_tag('bt_id', SELF.transaction.id) %]
32   <table>
33    <tr>
34     <th align="right">[%- LxERP.t8("Vendor") %]</th>
35     <td>
36             [%- INCLUDE 'generic/multibox.html'
37                  name          = 'vendor',
38                  select_name   = 'vendor_id',
39                  default       = ALL_VENDORS.size < limit ? vendor_id : vendor_name,
40                  style         = 'width: 250px',
41                  DATA          = ALL_VENDORS,
42                  id_key        = 'id',
43                  label_key     = 'name',
44                  limit         = limit,
45                  show_empty    = 1,
46                  allow_textbox = 1,
47                  class         = 'initial_focus',
48                  onChange      = 'filter_drafts();',
49                  -%]
50     </td>
51    </tr>
52   </table>
53 </form>
54
55   <p>
56    <a href="#" onclick="$('#create_invoice_window').dialog('close');">[% LxERP.t8("Cancel") %]</a>
57   </p>
58
59   <hr>
60 <div id="drafts">
61 [% IF DRAFTS.size %]
62 [% 'Draft suggestions' | $T8 %]:
63
64
65   <table>
66    <tr>
67     <th class="listheading">[% 'Description' | $T8 %]</th>
68     <th class="listheading">[% 'Vendor' | $T8 %]</th>
69     <th class="listheading">[% 'Employee' | $T8 %]</th>
70     <th class="listheading">[% 'Draft from:' | $T8 %]</th>
71    </tr>
72
73    [% FOREACH draft = DRAFTS %]
74     <tr class="listrow[% loop.count % 2 %]">
75      <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>
76      <td>[% HTML.escape(draft.vendor) %]</td>
77      <td>[% HTML.escape(draft.employee.name) %]</td>
78      <td>[% HTML.escape(draft.itime_as_date) %]</td>
79     </tr>
80    [% END %]
81   </table>
82 [% ELSE %]
83   <p class="message_hint">[% 'No draft was found.' | $T8 %]</p>
84 [% END %]
85 </div>
86
87 <script type="text/javascript">
88 <!--
89
90 function filter_drafts() {
91   var url="controller.pl?action=BankTransaction/filter_drafts&" + $("#create_invoice_window form").serialize();
92   $.ajax({
93     url: url,
94     success: function(new_data) {
95       $("#drafts").html(new_data['html']);
96     }
97   });
98 }
99 //-->
100 </script>
101