Merge branch 'sales-purchase-longdescription-jquery-dialog'
[kivitendo-erp.git] / templates / webpages / is / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- SET follow_up_trans_info = invnumber _ ' (' _ customer_name _ ')' %]
6 <script type="text/javascript" src="js/common.js"></script>
7 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
8 <script type="text/javascript" src="js/vendor_selection.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 <script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
12
13 <form method="post" name="invoice" action="[% script %]">
14
15 [%- FOREACH key = HIDDENS %]
16 <input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
17 [%- END %]
18 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
19 <input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
20 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
21 <input type="hidden" name="follow_up_rowcount" value="1">
22
23 <h1>[% title %]</h1>
24
25 <p>[% saved_message %]</p>
26
27 [%- PROCESS 'common/flash.html' %]
28 [%- INCLUDE 'generic/set_longdescription.html' %]
29
30 <div class="tabwidget">
31  <ul>
32   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
33 [%- IF INSTANCE_CONF.get_webdav %]
34   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
35 [%- END %]
36 [%- IF id %]
37   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
38 [%- END %]
39  </ul>
40
41 <div id="ui-tabs-basic-data">
42 <table width="100%">
43   <tr>
44     <td valign="top">
45       <table>
46         <tr>
47           <th align="right">[% 'Customer' | $T8 %]</th>
48           <td>
49             [%- INCLUDE 'generic/multibox.html'
50                  id            = 'customer',
51                  name          = 'customer',
52                  style         = 'width: 250px',
53                  class         = 'initial_focus',
54                  DATA          = ALL_CUSTOMERS,
55                  id_sub        = 'vc_keys',
56                  label_key     = 'name',
57                  select        = vc_select,
58                  limit         = vclimit,
59                  allow_textbox = 1,
60                  onChange      = "document.getElementById('update_button').click();" -%]
61             <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')">
62           <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
63           <input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]">
64           <input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]">
65           <input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]">
66           </td>
67         </tr>
68 [%- IF ALL_CONTACTS.size %]
69         <tr>
70           <th align="right">[% 'Contact Person' | $T8 %]</th>
71           <td>
72             [% 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') %]
73           </td>
74         </tr>
75 [%- END %]
76 [%- IF ALL_SHIPTO.size %]
77         <tr>
78           <th align="right">[% 'Shipping Address' | $T8 %]</th>
79           <td>
80             [% L.select_tag('shipto_id', ALL_SHIPTO, default = shipto_id, value_key = 'shipto_id', title_key = 'displayable_id', with_empty = 1, style='width: 250px', onChange = "document.getElementById('update_button').click();") %]
81           </td>
82         </tr>
83 [%- END %]
84         <tr>
85           <td align="right">[% 'Credit Limit' | $T8 %]</td>
86           <td>
87             [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
88             <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
89           </td>
90         </tr>
91 [%- IF max_dunning_level %]
92         <tr>
93           <th align="right">[% 'Max. Dunning Level' | $T8 %]:</th>
94           <td>
95             <b>[% max_dunning_level %]</b>; [% 'Dunning Amount' | $T8 %]: <b>[% LxERP.format_amount(dunning_amount,2) %]</b>
96           </td>
97         </tr>
98 [%- END %]
99 [%- IF business %]
100         <tr>
101           <th align="right">[% 'Customer type' | $T8 %]</th>
102           <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
103         </tr>
104 [%- END %]
105         <tr>
106           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
107           <td colspan="3">
108             <select name="AR" style="width:250px;">[% selectAR %]</select>
109             <input type="hidden" name="selectAR" value="[% selectAR | html %]">
110           </td>
111         </tr>
112         <tr>
113           <th align="right">[% 'Steuersatz' | $T8 %]</th>
114           <td>
115             [% L.select_tag('taxzone_id', ALL_TAXZONES, default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
116   [%- IF id %]
117           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
118   [%- END %]
119           </td>
120         </tr>
121 [%- IF all_departments %]
122         <tr>
123           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
124           <td colspan="3">
125             [% L.select_tag('department_id', all_departments, default = department_id, title_sub = \department_labels, with_empty = 1, style = 'width:250px') %]
126           </td>
127         </tr>
128 [%- END %]
129 [%- IF currencies %]
130         <tr>
131           <th align="right">[% 'Currency' | $T8 %]</th>
132           <td>[% currencies %]</td>
133         </tr>
134 [%- END %]
135         <tr style='display:none'>
136           <td>
137             <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
138             <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
139           </td>
140         </tr>
141 [%- IF show_exchangerate %]
142         <tr>
143           <th align="right">[% 'Exchangerate' | $T8 %]</th>
144           <td>
145            [%- IF forex %]
146             [% LxERP.format_amount(exchangerate, 2) %]
147            [%- ELSE %]
148             <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
149            [%- END %]
150           </td>
151         </tr>
152 [%- END %]
153         <tr>
154           <th align="right" nowrap>[% 'Shipping Point' | $T8 %]</th>
155           <td colspan="3"><input size='35' name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
156         </tr>
157         <tr>
158           <th align="right" nowrap>[% 'Ship via' | $T8 %]</th>
159           <td colspan="3"><input size='35' name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
160         </tr>
161         <tr>
162           <th align="right">[% 'Transaction description' | $T8 %]</th>
163           <td colspan="3"><input size='35' name="transaction_description" value="[% HTML.escape(transaction_description) %]"></td>
164         </tr>
165       </table>
166     </td>
167     <td align="right" valign="top">
168       <table>
169         <tr>
170           <th align="right">[% 'Employee' | $T8 %]</th>
171           <td>
172             [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
173           </td>
174         </tr>
175 [%- IF ALL_SALESMEN.size %]
176         <tr>
177           <th align="right">[% 'Salesman' | $T8 %]</th>
178           <td>
179             [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
180           </td>
181         </tr>
182 [%- END %]
183
184 [%- IF is_type_credit_note %]
185         <tr>
186           <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
187           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
188         </tr>
189         <tr>
190           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
191           <td colspan="3"><input size='11' name="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
192         </tr>
193         <tr>
194           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
195           <td>[% L.date_tag('invdate', invdate, onchange='set_duedate()') %]</td>
196         </tr>
197 [%- ELSE %]
198         <tr>
199           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
200           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
201         </tr>
202         <tr>
203           <th align="right">[% 'Invoice Date' | $T8 %]</th>
204           <td>[% L.date_tag('invdate', invdate, onchange='set_duedate()') %]</td>
205         </tr>
206         <tr>
207           <th align="right">[% 'Due Date' | $T8 %]</th>
208           <td>[% L.date_tag('duedate', duedate) %]</td>
209         </tr>
210         <tr>
211         <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
212           <td colspan="3"><input size='11' name="donumber" value="[% HTML.escape(donumber) %]"></td>
213         </tr>
214 [%- END %]
215         <tr>
216           <th align="right">[% 'Delivery Date' | $T8 %]</th>
217           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
218         </tr>
219         <tr>
220           <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
221           <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
222         </tr>
223         <tr>
224           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
225           <td>[% L.date_tag('orddate', orddate) %]</td>
226         </tr>
227         <tr>
228           <th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
229           <td colspan="3"><input size='11' name="quonumber" value="[% HTML.escape(quonumber) %]"></td>
230         </tr>
231         <tr>
232           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
233           <td>[% L.date_tag('quodate', quodate) %]</td>
234         </tr>
235         <tr>
236           <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
237           <td colspan="3"><input size='11' name="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
238         </tr>
239         <tr>
240           <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
241           <td>
242             [%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]
243           </td>
244         </tr>
245       </table>
246     </td>
247   </tr>
248   <tr style='display:none'>
249     <td>
250       <input type="hidden" name="webdav" value="[% webdav %]">
251     </td>
252   </tr>
253 </table>
254
255   <script type="text/javascript" src="js/show_form_details.js"></script>
256   <script type="text/javascript" src="js/show_vc_details.js"></script>
257   <script type="text/javascript" src="js/show_history.js"></script>
258   <script type="text/javascript">
259    <!--
260      $('document').ready(function(){
261 [% IF resubmit && is_format_html %]
262        window.open('about:blank','Beleg');
263        document.invoice.target = 'Beleg';
264        document.invoice.submit();
265 [% ELSIF resubmit %]
266        document.invoice.submit();
267 [% ELSIF creditwarning != '' %]
268        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
269 [% ELSE %]
270 [% END %]
271      });
272      function set_duedate() {
273        $.ajax({
274          url: 'is.pl?action=set_duedate',
275          data: {
276            invdate: $('#invdate').val(),
277            payment_id: $('#payment_id').val(),
278          },
279          dataType: 'text',
280          success: function (data) { $('#duedate').val(data); }
281        })
282      }
283    //-->
284   </script>
285 <table width="100%">