a2ffd717ce93f6af754dcb7d341cd63949368835
[kivitendo-erp.git] / templates / webpages / delivery_order / tabs / basic_data.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6
7 [%- INCLUDE 'generic/set_longdescription.html' %]
8
9 <div id="ui-tabs-basic-data">
10   <table width="100%">
11     <tr valign="top">
12       <td>
13         <table width="100%">
14           <tr>
15             <th align="right">[%- SELF.cv == "customer" ? LxERP.t8('Customer') : LxERP.t8('Vendor') -%]</th>
16             [% SET cv_id = SELF.cv _ '_id' %]
17             <td>
18               [% P.customer_vendor.picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %]
19               [% P.button_tag("kivi.Order.show_vc_details_dialog()", LxERP.t8("Details (one letter abbreviation)")) %]
20             </td>
21           </tr>
22
23           <tr id='cp_row' [%- IF !SELF.order.${SELF.cv}.contacts.size %]style='display:none'[%- END %]>
24             <th align="right">[% 'Contact Person' | $T8 %]</th>
25             <td>[% L.select_tag('order.cp_id',
26                                 SELF.order.${SELF.cv}.contacts,
27                                 default=SELF.order.cp_id,
28                                 title_key='full_name_dep',
29                                 value_key='cp_id',
30                                 with_empty=1,
31                                 style='width: 300px') %]</td>
32           </tr>
33
34           <tr>
35             <th align="right">[% 'Shipping Address' | $T8 %]</th>
36             <td>
37               <span id='shipto_selection' [%- IF !SELF.order.${SELF.cv}.shipto.size %]style='display:none'[%- END %]>
38                 [% shiptos = [ { shipto_id => "", displayable_id => LxERP.t8("No/individual shipping address") } ] ;
39                    FOREACH s = SELF.order.${SELF.cv}.shipto ;
40                      shiptos.push(s) ;
41                    END ;
42                    L.select_tag('order.shipto_id',
43                                  shiptos,
44                                  default=SELF.order.shipto_id,
45                                  title_key='displayable_id',
46                                  value_key='shipto_id',
47                                  with_empty=0,
48                                  style='width: 300px') %]
49               </span>
50               [% L.button_tag("kivi.Order.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
51             </td>
52           </tr>
53
54           [%- PROCESS order/tabs/_business_info_row.html SELF=SELF %]
55
56           <tr>
57             <th align="right">[% 'Steuersatz' | $T8 %]</th>
58             <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>
59           </tr>
60
61           [% SET currency_id = SELF.order.currency_id || INSTANCE_CONF.get_currency_id  # use default currency for new order %]
62           <tr id="currency_settings">
63             <th align="right">[% 'Currency' | $T8 %]</th>
64             <td>[% L.select_tag('order.currency_id', SELF.all_currencies, default=currency_id, value_key='id', title_key='name') %]</td>
65           </tr>
66           <tr id="exchangerate_settings" [%- IF SELF.order.currency_id==INSTANCE_CONF.get_currency_id %]style='display:none'[%- END %]>
67             <th align="right">[% 'Exchangerate' | $T8 %]</th>
68             <td> 1 <span id="currency_name">[% SELF.order.currency.name %]</span> =
69               [% L.input_tag('order.exchangerate_as_null_number', SELF.order.exchangerate_as_null_number, size="15", class="reformat_number_as_null_number numeric") %]
70               [% INSTANCE_CONF.default_currency %]
71               [% L.hidden_tag('old_currency_id', currency_id) %]
72               [% L.hidden_tag('old_exchangerate', SELF.order.exchangerate_as_null_number) %]
73             </td>
74           </tr>
75
76 [%- IF SELF.all_languages.size %]
77           <tr>
78             <th align="right">[% 'Language' | $T8 %]</th>
79             <td>
80               [% L.select_tag('order.language_id', SELF.all_languages, default=SELF.order.language_id, title_key='description', with_empty=1, style='width:300px') %]
81             </td>
82           </tr>
83 [%- END %]
84
85 [%- IF SELF.all_departments.size %]
86           <tr>
87             <th align="right">[% 'Department' | $T8 %]</th>
88             <td>
89               [% L.select_tag('order.department_id', SELF.all_departments, default=SELF.order.department_id, title_key='description', with_empty=1, style='width:300px') %]
90             </td>
91           </tr>
92 [%- END %]
93
94           <tr>
95             <th align="right">[% 'Shipping Point' | $T8 %]</th>
96             <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>
97           </tr>
98
99           <tr>
100             <th align="right">[% 'Ship via' | $T8 %]</th>
101             <td>[% L.input_tag('order.shipvia', SELF.order.shipvia, style='width: 300px') %]</td>
102           </tr>
103
104           <tr>
105             <th align="right">[% 'Transaction description' | $T8 %]</th>
106             <td>[% L.input_tag('order.transaction_description', SELF.order.transaction_description, 'data-validate'=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '', style='width: 300px') %]</td>
107           </tr>
108
109           <tr>
110             <th align="right">[% 'Project Number' | $T8 %]</th>
111             <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
112           </tr>
113
114         </table>
115       </td>
116
117       <td align="right">
118         <table>
119
120           <tr>
121             <td colspan="2" align="center">
122               [%- IF SELF.order.id %]
123                 <label for="order.delivered">[% 'Delivery Order(s) for full qty created' | $T8 %]</label>
124                 [% L.yes_no_tag('order.delivered', SELF.order.delivered) %]
125                 <label for="order.closed">[% 'Closed' | $T8 %]</label>
126                 [% L.yes_no_tag('order.closed', SELF.order.closed) %]
127               [%- END %]
128             </td>
129           </tr>
130
131           <tr>
132             <th align="right">[% 'Employee' | $T8 %]</th>
133             <td>[% L.select_tag('order.employee_id',
134               SELF.all_employees,
135               default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
136               title_key='safe_name') %]</td>
137           </tr>
138
139           [% IF SELF.cv == 'customer' %]
140           <tr>
141             <th align="right">[% 'Salesman' | $T8 %]</th>
142             <td>[% L.select_tag('order.salesman_id',
143               SELF.all_salesmen,
144               default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
145               title_key='safe_name') %]</td>
146           </tr>
147           [% END %]
148
149           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
150           <tr>
151             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
152             <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]</td>
153           </tr>
154           [%- END -%]
155
156           [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
157             [%- SET quo_nr_txt = 'Quotation Number' -%]
158           [%- ELSE -%]
159             [%- SET quo_nr_txt = 'RFQ Number' -%]
160           [%- END -%]
161           <tr>
162             <th width="70%" align="right" nowrap>[% quo_nr_txt | $T8 %]</th>
163             [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
164               <td>[% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11) %]</td>
165             [%- ELSE -%]
166               <td>[% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]</td>
167             [%- END -%]
168           </tr>
169
170           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
171           <tr>
172             <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
173             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
174           </tr>
175           [%- END -%]
176
177           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
178             [%- SET transdate_txt = 'Order Date' -%]
179           [%- ELSIF SELF.type == "sales_quotation" -%]
180             [%- SET transdate_txt = 'Quotation Date' -%]
181           [%- ELSE -%]
182             [%- SET transdate_txt = 'RFQ Date' -%]
183           [%- END -%]
184           <tr>
185             <th width="70%" align="right" nowrap>[% transdate_txt | $T8 %]</th>
186             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
187           </tr>
188
189           <tr>
190             <th width="70%" align="right" nowrap>[% 'Tax point' | $T8 %]</th>
191             <td>[% L.date_tag('order.tax_point_as_date', SELF.order.tax_point_as_date, class="recalc") %]</td>
192           </tr>
193
194           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
195             [%- SET reqdate_txt = 'Reqdate'; SET reqdate_class = 'recalc' -%]
196           [%- ELSIF SELF.type == "sales_quotation" -%]
197             [%- SET reqdate_txt = 'Valid until'; SET reqdate_class = '' -%]
198           [%- ELSE -%]
199             [%- SET reqdate_txt = 'Required by'; SET reqdate_class = 'recalc' -%]
200           [%- END -%]
201           <tr>
202             <th width="70%" align="right" nowrap>[% reqdate_txt | $T8 %]</th>
203             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
204           </tr>
205
206           [%- IF SELF.type == "sales_quotation" -%]
207           <tr>
208             <th width="70%" align="right" nowrap>[% 'Order probability' | $T8 %]</th>
209             <td>[%- L.select_tag('order.order_probability', SELF.order_probabilities, title='title', default=SELF.order.order_probability) %]%</td>
210           </tr>
211           <tr>
212             <th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th>
213             <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_as_date) %]</td>
214           </tr>
215           [%- END %]
216
217           <tr>
218             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
219             <td>[% SELF.order.itime_as_date %]</td>
220           </tr>
221
222         </table>
223
224       </td>
225     </tr>
226   </table>
227
228   [%- PROCESS order/tabs/_item_input.html SELF=SELF %]
229
230   [% L.button_tag('kivi.Order.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
231
232   <table width="100%">
233     <tr>
234       <td>
235         [%- IF SELF.positions_scrollbar_height -%]
236           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
237         [%- ELSE -%]
238           [%- SET scroll_style = '' -%]
239         [%- END -%]
240         <div id="row_table_scroll_id" [%- scroll_style -%]>
241           <table id="row_table_id" width="100%">
242             <thead>
243               <tr class="listheading">
244                 <th class="listheading" style='text-align:center' nowrap width="1">
245                   [%- IF MYCONFIG.show_form_details %]
246                     [%- L.img_tag(src="image/collapse.svg", alt=LxERP.t8('Hide all details'), title=LxERP.t8('Hide all details'), id='expand_all', "data-expanded"="1") %]
247                   [%- ELSE %]
248                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
249                   [%- END %]
250                 </th>
251                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
252                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
253                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
254                 [%- IF SELF.show_update_button -%]
255                 <th class="listheading" style='text-align:center' nowrap width="1">
256                   [%- L.img_tag(src="image/rotate_cw.svg",
257                                 alt=LxERP.t8('Update from master data'),
258                                 title= LxERP.t8('Update from master data'),
259                                 onclick="if (!confirm('" _ LxERP.t8("Are you sure to update all positions from master data?") _ "')) return false; kivi.Order.update_all_rows_from_master_data();",
260                                 id='update_from_master') %]
261                 </th>
262                 [%- END %]
263                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
264                 [%- IF SELF.search_cvpartnumber -%]
265                 <th id="cvpartnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("cvpartnumber")' > [%- SELF.cv == "customer" ? LxERP.t8('Customer Part Number') : LxERP.t8('Model') %]</a></th>
266                 [%- END -%]
267                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
268                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.Order.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
269                 [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
270                 <th id="shipped_qty_header_id"  class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Order.reorder_items("shipped_qty")'>[%- 'Delivered'   | $T8 %]</a></th>
271                 [%- END -%]
272                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Order.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
273                 <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
274                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
275                 <th class="listheading" nowrap width="5" >[%- 'Price Source' | $T8 %] </th>
276                 <th id="sellprice_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("sellprice")'> [%- 'Price'       | $T8 %]</a></th>
277                 <th id="discount_header_id"    class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("discount")'>  [%- 'Discount'    | $T8 %]</a></th>
278                 <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
279               </tr>
280             </thead>
281
282             [%- FOREACH item = SELF.order.items_sorted %]
283               [%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
284             [%- END %]
285
286           </table>
287         </div>
288
289       </td>
290     </tr>
291
292     <tr>
293     </tr>
294
295     <tr>
296       <td colspan="100%" width="100%">
297         <table width="100%">
298           <tr>
299             <td>
300               <table>
301                 <tr>
302                   <th align="left">[% 'Notes' | $T8 %]</th>
303                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
304                 </tr>
305                 <tr valign="top">
306                   <td>
307                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
308                   </td>
309                   <td>
310                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
311                   </td>
312                 </tr>
313               </table>
314             </td>
315
316             <td>
317               <table>
318                 <tr>
319                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
320                   <td>[% L.select_tag('order.payment_id',
321                                       SELF.all_payment_terms,
322                                       default = SELF.order.payment_id,
323                                       with_empty = 1,
324                                       title_key = 'description',
325                                       style = 'width: 250px') %]</td>
326                 </tr>
327                 <tr>
328                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
329                   <td>[% L.select_tag('order.delivery_term_id',
330                                       SELF.all_delivery_terms,
331                                       default = SELF.order.delivery_term_id,
332                                       with_empty = 1,
333                                       title_key = 'description',
334                                       style = 'width: 250px') %]</td>
335                 </tr>
336               </table>
337             </td>
338
339           </tr>
340         </table>
341       </td>
342     </tr>
343
344   </table>
345
346 </div>
347
348 [% L.sortable_element('#row_table_id') %]