bee0ee6c4abd99bff565873abacaf261570978d2
[kivitendo-erp.git] / templates / webpages / do / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %][%- USE P -%]
5
6 [%# Determine which shipping address to show if the delivery order has been shipped already. %]
7 [%- IF delivered;
8       SET shipto_label = [];
9       IF shipto_id;
10         FOREACH row = ALL_SHIPTO ;
11           IF row.shipto_id == shipto_id ;
12             SET shipto_label = [ row.shiptoname, row.shiptodepartment_1, row.shiptostreet, row.shiptocity ] ;
13           END ;
14         END ;
15       ELSE ;
16         SET shipto_label = [ shiptoname, shiptodepartment_1, shiptostreet, shiptocity ] ;
17       END ;
18
19       SET shipto_label = shipto_label.grep('.') ;
20       IF !shipto_label.size ;
21         shipto_label = [ LxERP.t8('no shipping address') ] ;
22       END ;
23     END ; %]
24
25 <h1>[% title %]</h1>
26
27  <script type="text/javascript" src="js/show_form_details.js"></script>
28  <script type="text/javascript" src="js/show_history.js"></script>
29  <script type="text/javascript" src="js/show_vc_details.js"></script>
30  <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
31  <script type="text/javascript" src="js/calculate_qty.js"></script>
32  <script type="text/javascript" src="js/stock_in_out.js"></script>
33  <script type="text/javascript" src="js/follow_up.js"></script>
34  <script type="text/javascript" src="js/kivi.SalesPurchase.js"></script>
35
36  <style type="text/css">
37   .fixed_width {
38     width: 250px;
39   }
40  </style>
41
42  [%- IF vc == 'customer' %]
43  [%- SET is_customer = '1' %]
44  [%- ELSE %]
45  [%- SET vc = 'vendor' %]
46  [%- SET is_customer = '0' %]
47  [%- END %]
48  [%- SET vc_id = vc _ "_id" %]
49  [%- IF delivered %]
50  [%- SET DISABLED = ' disabled' %]
51  [%- END %]
52
53 [%- INCLUDE 'common/flash.html' %]
54 [%- INCLUDE 'generic/set_longdescription.html' %]
55
56  [%- IF ERRORS && ERRORS.size %]
57  <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
58  [%- END %]
59
60  <form id="form" method="post" name="do" action="do.pl">
61
62  <div id="do_tabs" class="tabwidget">
63   <ul>
64    <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
65 [%- IF INSTANCE_CONF.get_webdav %]
66    <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
67 [%- END %]
68 [%- IF id AND INSTANCE_CONF.get_doc_storage %]
69       <li><a href="controller.pl?action=File/list&file_type=document&object_type=[% HTML.escape(type) %]&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
70       <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=[% HTML.escape(type) %]&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
71 [%- END %]
72 [%- IF id AND AUTH.assert('record_links', 1) %]
73    <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=DeliveryOrder&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
74 [%- END %]
75   </ul>
76
77   <div id="ui-tabs-basic-data">
78
79   <input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
80   <input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
81   <input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
82   <input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount" value="1">
83
84
85   <input type="hidden" name="business" id="business" value="[% HTML.escape(business) %]">
86   <input type="hidden" name="closed" id="closed" value="[% HTML.escape(closed) %]">
87   <input type="hidden" name="convert_from_oe_ids" id="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
88   <input type="hidden" name="currency" id="currency" value="[% HTML.escape(currency) %]">
89   <input type="hidden" name="customer_pricegroup_id" id="customer_pricegroup_id" value="[% HTML.escape(customer_pricegroup_id) %]">
90   <input type="hidden" name="discount" id="discount" value="[% HTML.escape(discount) %]">
91   <input type="hidden" name="dunning_amount" id="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
92   <input type="hidden" name="emailed" id="emailed" value="[% HTML.escape(emailed) %]">
93   <input type="hidden" name="id" id="id" value="[% HTML.escape(id) %]">
94   <input type="hidden" name="max_dunning_level" id="max_dunning_level" value="[% HTML.escape(max_dunning_level) %]">
95   <input type="hidden" name="printed" id="printed" value="[% HTML.escape(printed) %]">
96   <input type="hidden" name="proforma" id="proforma" value="[% HTML.escape(proforma) %]">
97   <input type="hidden" name="queued" id="queued" value="[% HTML.escape(queued) %]">
98   <input type="hidden" name="saved_donumber" id="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
99  [%- IF delivered %]
100   <input type="hidden" name="shipto_id" id="shipto_id" value="[% HTML.escape(shipto_id) %]">
101   <input type="hidden" name="shiptocity" id="shiptocity" value="[% HTML.escape(shiptocity) %]">
102   <input type="hidden" name="shiptocontact" id="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
103   <input type="hidden" name="shiptocp_gender" id="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
104   <input type="hidden" name="shiptocountry" id="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
105   <input type="hidden" name="shiptogln" id="shiptogln" value="[% HTML.escape(shiptogln) %]">
106   <input type="hidden" name="shiptodepartment_1" id="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
107   <input type="hidden" name="shiptodepartment_2" id="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
108   <input type="hidden" name="shiptoemail" id="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
109   <input type="hidden" name="shiptofax" id="shiptofax" value="[% HTML.escape(shiptofax) %]">
110   <input type="hidden" name="shiptoname" id="shiptoname" value="[% HTML.escape(shiptoname) %]">
111   <input type="hidden" name="shiptophone" id="shiptophone" value="[% HTML.escape(shiptophone) %]">
112   <input type="hidden" name="shiptostreet" id="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
113   <input type="hidden" name="shiptozipcode" id="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
114   <input type="hidden" name="shiptocp_gender" id="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
115  [%- END %]
116   <input type="hidden" name="show_details" id="show_details" value="[% HTML.escape(show_details) %]">
117   <input type="hidden" name="taxincluded" id="taxincluded" value="[% HTML.escape(taxincluded) %]">
118   <input type="hidden" name="taxzone_id" id="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
119   <input type="hidden" name="title" id="title" value="[% HTML.escape(title) %]">
120   <input type="hidden" name="type" id="type" value="[% HTML.escape(type) %]">
121   <input type="hidden" name="vc" id="vc" value="[% HTML.escape(vc) %]">
122   <input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
123   <input type="hidden" name="tax_point" id="tax_point" value="[% HTML.escape(tax_point) %]">
124
125   <p>
126    <table width="100%">
127     <tr valign="top">
128      <td>
129       <table width="100%">
130        <tr>
131         <th align="right">[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
132         <td>
133          [% IF RO %]
134           [% P.hidden_tag(vc_id, $vc_id) %]
135           [% HTML.escape(VC_OBJ.name) %]
136          [% ELSE %]
137           [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="fixed_width", onchange="\$('#update_button').click()") %]
138          [% END %]
139          [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
140          [% P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)")) %]
141         </td>
142
143         [%- IF ALL_CONTACTS.size %]
144         <tr>
145          <th align="right">[% 'Contact Person' | $T8 %]</th>
146          <td>
147           [%- IF delivered %]
148             [% L.hidden_tag("cp_id", cp_id) %]
149             [% HTML.escape(CONTACT_OBJ.full_name) %][% IF CONTACT_OBJ.cp_abteilung %] ([% HTML.escape(CONTACT_OBJ.cp_abteilung) %])[% END %]
150           [%- ELSE %]
151             [% 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') %]
152           [%- END %]
153          </td>
154         </tr>
155         [%- END %]
156
157         <tr>
158          <th align="right">[% 'Shipping Address' | $T8 %]</th>
159          <td>
160           [%- IF delivered %]
161            [% HTML.escape(shipto_label.join('; ')) %]
162           [%- ELSE %]
163            [%- IF ALL_SHIPTO.size %]
164             [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
165                L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
166            [%- END %]
167            [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
168           [%- END %]
169          </td>
170         </tr>
171
172         [%- IF (vc == 'customer') && VC_OBJ.additional_billing_addresses.as_list.size %]
173         <tr>
174           <th align="right">[% 'Custom Billing Address' | $T8 %]</th>
175           <td>
176             [% L.select_tag('billing_address_id', VC_OBJ.additional_billing_addresses,
177                             with_empty=1, default=billing_address_id, value_key='id', title_key='displayable_id', style='width: 250px') %]
178           </td>
179         </tr>
180         [%- END %]
181
182         [%- IF business %]
183         <tr>
184          <th align="right">[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
185          <td>[% HTML.escape(business) %]</td>
186         </tr>
187         [%- END %]
188
189         [%- IF max_dunning_level %]
190         <tr>
191          <th align="right">[% 'Max. Dunning Level' | $T8 %]</th>
192          <td>
193           <b>[% HTML.escape(max_dunning_level) %]</b>; [% 'Dunning Amount' | $T8 %]:
194           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
195          </td>
196         </tr>
197         [%- END %]
198        </tr>
199
200        [%- IF ALL_LANGUAGES.size %]
201        <tr>
202         <th align="right" nowrap>[% 'Language' | $T8 %]</th>
203         <td colspan="3">
204          [% L.select_tag('language_id', ALL_LANGUAGES, default = language_id, title_key = 'description', with_empty = 1, style = 'width: 250px' )%]
205         </td>
206        </tr>
207        [%- END %]
208
209        [%- IF ALL_DEPARTMENTS.size %]
210        <tr>
211         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
212         <td colspan="3">
213           [% IF ( delivered ) %]
214             [% L.hidden_tag('department_id', department_id) %]
215           [% ELSE %]
216             [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
217           [% END %]
218        </td>
219        </tr>
220        [%- END %]
221
222        <tr>
223         <th align="right">[% 'Shipping Point' | $T8 %]</th>
224         <td colspan="3"><input name="shippingpoint" size="35" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
225        </tr>
226
227        <tr>
228         <th align="right">[% 'Ship via' | $T8 %]</th>
229         <td colspan="3"><input name="shipvia" size="35" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
230        </tr>
231
232        <tr>
233         <th align="right">[% 'Transaction description' | $T8 %]</th>
234         <td colspan="3">[% L.input_tag("transaction_description", transaction_description, size=35, "data-validate"=(INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : ''), readonly=delivered) %]</td>
235        </tr>
236
237       </table>
238      </td>
239
240      <td align="right">
241       <table>
242
243        <tr>
244         <td colspan="2" align="center">
245          [%- IF delivered %]
246           [%- IF is_customer %]
247           [% 'transferred out' | $T8 %]
248           [%- ELSE %]
249           [% 'transferred in' | $T8 %]
250           [%- END %]
251          [%- ELSE %]
252           [%- IF is_customer %]
253           [% 'not transferred out yet' | $T8 %]
254           [%- ELSE %]
255           [% 'not transferred in yet' | $T8 %]
256           [%- END %]
257          [%- END %]
258          ;
259          [%- IF closed %]
260           [% 'Closed' | $T8 %]
261          [%- ELSE %]
262           [% 'Open' | $T8 %]
263          [%- END %]
264         </td>
265        </tr>
266
267        <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
268
269        <tr>
270         <th align="right">[% 'Employee' | $T8 %]</th>
271         <td>
272          [%- IF delivered %]
273          <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
274          [%- FOREACH row = ALL_EMPLOYEES %]
275          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
276          [%- END %]
277          [%- ELSE %]
278            [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
279          [%- END %]
280         </td>
281        </tr>
282
283        [%- IF is_customer %]
284        [%- IF salesman_id %]
285        [%- SET the_salesman_id = salesman_id %]
286        [%- ELSE %]
287        [%- SET the_salesman_id = employee_id %]
288        [%- END %]
289        <tr>
290         <th align="right">[% 'Salesman' | $T8 %]</th>
291         <td>
292          [%- IF delivered %]
293          <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
294          [%- FOREACH row = ALL_SALESMEN %]
295          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
296          [%- END %]
297          [%- ELSE %]
298           [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
299          [%- END %]
300         </td>
301        </tr>
302        [%- END %]
303
304        <tr>
305         <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
306         <td>
307 [%- IF !is_customer || INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
308           [% L.input_tag("donumber", donumber, size="11", readonly=delivered) %]
309 [%- ELSIF id %]
310           [% HTML.escape(donumber) %]
311           [% L.hidden_tag("donumber", donumber) %]
312 [%- ELSE %]
313           [% LxERP.t8("will be set upon saving") %]
314 [%- END %]
315         </td>
316        </tr>
317
318        <tr>
319         <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
320         <td><input name="ordnumber" id="ordnumber" size="11" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
321        </tr>
322
323        <tr>
324         <th width="70%" align="right" nowrap>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
325         <td><input name="cusordnumber" id="cusordnumber" size="11" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
326        </tr>
327
328        <tr>
329         <th align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
330         <td nowrap>
331          [% L.date_tag('transdate', transdate, readonly => delivered) %]
332         </td>
333        </tr>
334
335        <tr>
336         <th align="right" nowrap>[% 'Reqdate' | $T8 %]</th>
337         <td nowrap>
338          [% L.date_tag('reqdate', reqdate, readonly => delivered) %]
339         </td>
340        </tr>
341
342        [%- IF is_customer %]
343        <tr>
344         <th align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
345         <td>[% insertdate %]</td>
346        </tr>
347        [%- END %]
348
349        <tr>
350         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
351         <td>
352          [%- IF delivered %]
353          <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
354          [%- FOREACH row = ALL_PROJECTS %]
355          [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
356          [%- END %]
357          [%- ELSE %]
358          <select name="globalproject_id">
359           <option></option>
360           [%- FOREACH row = ALL_PROJECTS %]
361           <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
362           [%- END %]
363          </select>
364          [%- END %]
365         </td>
366        </tr>
367       </table>
368      </td>
369     </tr>
370    </table>