Merge branch '2020-leistungsdatum'
[kivitendo-erp.git] / templates / webpages / ir / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %][%- USE P -%]
5 <h1>[% title %]</h1>
6
7 [%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_obj.name _ ')' %]
8 <script type="text/javascript" src="js/common.js"></script>
9 <script type="text/javascript" src="js/calculate_qty.js"></script>
10 <script type="text/javascript" src="js/follow_up.js"></script>
11
12 <form id='form' method="post" name="invoice" action="[% script %]">
13
14 <p>[% saved_message %]</p>
15
16 [%- FOREACH key = HIDDENS %]
17 <input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
18 [%- END %]
19 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
20 <input type="hidden" name="follow_up_trans_type_1" value="purchase_invoice">
21 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
22 <input type="hidden" name="follow_up_rowcount" value="1">
23 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
24
25 [%- INCLUDE 'common/flash.html' %]
26 [%- INCLUDE 'generic/set_longdescription.html' %]
27
28 <div id="ir_tabs" class="tabwidget">
29  <ul>
30   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
31 [%- IF INSTANCE_CONF.get_webdav %]
32   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
33 [%- END %]
34 [%- IF id %]
35   [%- IF INSTANCE_CONF.get_doc_storage %]
36   <li><a href="controller.pl?action=File/list&file_type=document&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
37   <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
38   [%- END %]
39   [%- IF AUTH.assert('record_links', 1) %]
40   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
41   [%- END %]
42   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
43 [%- END %]
44  </ul>
45
46  <div id="ui-tabs-basic-data">
47 <table width="100%">
48   <tr>
49     <td valign="top">
50       <table>
51         <tr>
52           <th align="right">[% 'Vendor' | $T8 %]</th>
53           <td>
54            [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
55            [% P.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
56            [% P.hidden_tag("previous_vendor_id", vendor_id) %]
57           </td>
58         </tr>
59 [%- IF ALL_CONTACTS.size %]
60         <tr>
61           <th align="right">[% 'Contact Person' | $T8 %]</th>
62           <td>
63             [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style = 'width: 250px') %]
64           </td>
65         </tr>
66 [%- END %]
67         <tr>
68           <td align="right">[% 'Credit Limit' | $T8 %]</td>
69           <td>
70             [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
71             <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
72           </td>
73         </tr>
74 [%- IF invoice_obj.sepa_exports.as_list.size %]
75         <tr>
76           <th align="right">[% LxERP.t8("SEPA exports") %]</th>
77           <td>
78            [% FOREACH export = invoice_obj.sepa_exports.as_list %]
79             <a href="sepa.pl?action=bank_transfer_edit&vc=vendor&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
80             [% UNLESS loop.last %], [% END %]
81            [% END %]
82           </td>
83         </tr>
84 [%- END %]
85 [%- IF business %]
86         <tr>
87           <th align="right">[% 'Vendor type' | $T8 %]</th>
88           <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
89         </tr>
90 [%- END %]
91         <tr>
92           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
93           <td colspan="3"><select name="AP" style="width:250px;">[% selectAP %]</select></td>
94           <input type="hidden" name="selectAP" value="[% selectAP %]">
95         </tr>
96         <tr>
97           <th align="right">[% 'Steuersatz' | $T8 %]</th>
98           <td>
99             [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
100   [%- IF id %]
101           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
102   [%- END %]
103           </td>
104   [%- IF id %]
105           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
106   [%- END %]
107         </tr>
108 [%- IF ALL_DEPARTMENTS.as_list.size %]
109         <tr>
110           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
111           <td colspan="3">[% P.select_tag("department_id", ALL_DEPARTMENTS, with_empty=1, default=department_id, title_key="description", style="width: 250px") %]</td>
112         </tr>
113 [%- END %]
114 [%- IF currencies %]
115         <tr>
116           <th align="right">[% 'Currency' | $T8 %]</th>
117           <td>[% currencies %]</td>
118         </tr>
119 [%- END %]
120         <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
121         <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
122 [%- IF show_exchangerate %]
123         <tr>
124           <th align="right">[% 'Exchangerate' | $T8 %]</th>
125           <td>
126            [%- IF forex %]
127             [% LxERP.format_amount(exchangerate, 5) %]
128            [%- ELSE %]
129             <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
130            [%- END %]
131           </td>
132         </tr>
133 [%- END %]
134       </table>
135     </td>
136     <td align="right" valign="top">
137       <table>
138         <tr>
139           <th align="right">[% 'Employee' | $T8 %]</th>
140           <td>[% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]</td>
141         </tr>
142         <tr>
143           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
144           <td colspan="3">[% L.input_tag("invnumber", invnumber, size="11") %]</td>
145         </tr>
146         <tr>
147           <th align="right">[% 'Invoice Date' | $T8 %]</th>
148           <td>[% L.date_tag('invdate', invdate, onChange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
149         </tr>
150         <tr>
151           <th align="right">[% 'Due Date' | $T8 %]</th>
152           <td>
153            <span id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate) %]</span>
154            <span id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate) %]</span>
155           </td>
156         </tr>
157         <tr>
158           <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
159           <td nowrap>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
160         </tr>
161         <tr>
162           <th align="right">[% 'Delivery Date' | $T8 %]</th>
163           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
164         </tr>
165         <tr>
166           <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
167           <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
168         </tr>
169         <tr>
170           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
171           <td>[% L.date_tag('orddate', orddate) %]</td>
172         </tr>
173         <tr>
174           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
175           <td>[% L.date_tag('quodate', quodate) %]</td>
176         </tr>
177         <tr>
178           <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
179           <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]</td>
180         </tr>
181       </table>
182     </td>
183   </tr>
184 </table>
185     </td>
186   </tr>
187   <tr>
188     <td>
189     </td>
190   </tr>
191   <script type="text/javascript" src="js/show_form_details.js"></script>
192   <script type="text/javascript" src="js/show_vc_details.js"></script>
193   <script type="text/javascript" src="js/show_history.js"></script>
194   <script type="text/javascript">
195    <!--
196      $('document').ready(function(){
197 [% IF creditwarning != '' %]
198        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
199 [% ELSE %]
200 [% END %]
201      });
202    //-->
203   </script>
204   <input type="hidden" name="webdav" value="[% webdav | html %]">