96ef3e79b990cbcd0243340e5fdc3de44da93766
[kivitendo-erp.git] / templates / webpages / 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>
153               [%- IF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
154                 [% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]
155               [%- ELSIF SELF.order.id %]
156                 [% HTML.escape(SELF.order.ordnumber) %]
157                 [% L.hidden_tag("order.ordnumber", SELF.order.ordnumber) %]
158               [% ELSE %]
159                 [% LxERP.t8("will be set upon saving") %]
160               [%- END %]
161             </td>
162           </tr>
163           [%- END -%]
164
165           [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
166             [%- SET quo_nr_txt = 'Quotation Number' -%]
167           [%- ELSE -%]
168             [%- SET quo_nr_txt = 'RFQ Number' -%]
169           [%- END -%]
170           <tr>
171             <th width="70%" align="right" nowrap>[% quo_nr_txt | $T8 %]</th>
172             <td>
173               [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
174                 [% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11) %]
175               [%- ELSIF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
176                 [% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]
177               [%- ELSIF SELF.order.id %]
178                 [% HTML.escape(SELF.order.quonumber) %]
179                 [% L.hidden_tag("order.quonumber", SELF.order.quonumber) %]
180               [% ELSE %]
181                 [% LxERP.t8("will be set upon saving") %]
182               [%- END %]
183             </td>
184           </tr>
185
186           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
187           <tr>
188             <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
189             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
190           </tr>
191           [%- END -%]
192
193           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
194             [%- SET transdate_txt = 'Order Date' -%]
195           [%- ELSIF SELF.type == "sales_quotation" -%]
196             [%- SET transdate_txt = 'Quotation Date' -%]
197           [%- ELSE -%]
198             [%- SET transdate_txt = 'RFQ Date' -%]
199           [%- END -%]
200           <tr>
201             <th width="70%" align="right" nowrap>[% transdate_txt | $T8 %]</th>
202             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
203           </tr>
204
205           <tr>
206             <th width="70%" align="right" nowrap>[% 'Tax point' | $T8 %]</th>
207             <td>[% L.date_tag('order.tax_point_as_date', SELF.order.tax_point_as_date, class="recalc") %]</td>
208           </tr>
209
210           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
211             [%- SET reqdate_txt = 'Reqdate'; SET reqdate_class = 'recalc' -%]
212           [%- ELSIF SELF.type == "sales_quotation" -%]
213             [%- SET reqdate_txt = 'Valid until'; SET reqdate_class = '' -%]
214           [%- ELSE -%]
215             [%- SET reqdate_txt = 'Required by'; SET reqdate_class = 'recalc' -%]
216           [%- END -%]
217           <tr>
218             <th width="70%" align="right" nowrap>[% reqdate_txt | $T8 %]</th>
219             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
220           </tr>
221
222           [%- IF SELF.type == "sales_quotation" -%]
223           <tr>
224             <th width="70%" align="right" nowrap>[% 'Order probability' | $T8 %]</th>
225             <td>[%- L.select_tag('order.order_probability', SELF.order_probabilities, title='title', default=SELF.order.order_probability) %]%</td>
226           </tr>
227           <tr>
228             <th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th>
229             <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_as_date) %]</td>
230           </tr>
231           [%- END %]
232
233           <tr>
234             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
235             <td>[% SELF.order.itime_as_date %]</td>
236           </tr>
237
238         </table>
239
240       </td>
241     </tr>
242   </table>
243
244   [%- PROCESS order/tabs/_item_input.html SELF=SELF %]
245
246   [% L.button_tag('kivi.Order.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
247
248   <table width="100%">
249     <tr>
250       <td>
251         [%- IF SELF.positions_scrollbar_height -%]
252           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
253         [%- ELSE -%]
254           [%- SET scroll_style = '' -%]
255         [%- END -%]
256         <div id="row_table_scroll_id" [%- scroll_style -%]>
257           <table id="row_table_id" width="100%">
258             <thead>
259               <tr class="listheading">
260                 <th class="listheading" style='text-align:center' nowrap width="1">
261                   [%- IF MYCONFIG.show_form_details %]
262                     [%- 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") %]
263                   [%- ELSE %]
264                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
265                   [%- END %]
266                 </th>
267                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
268                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
269                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
270                 [%- IF SELF.show_update_button -%]
271                 <th class="listheading" style='text-align:center' nowrap width="1">
272                   [%- L.img_tag(src="image/rotate_cw.svg",
273                                 alt=LxERP.t8('Update from master data'),
274                                 title= LxERP.t8('Update from master data'),
275                                 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();",
276                                 id='update_from_master') %]
277                 </th>
278                 [%- END %]
279                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
280                 [%- IF SELF.search_cvpartnumber -%]
281                 <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>
282                 [%- END -%]
283                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
284                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.Order.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
285                 [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
286                 <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>
287                 [%- END -%]
288                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Order.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
289                 <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
290                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
291                 <th class="listheading" nowrap width="5" >[%- 'Price Source' | $T8 %] </th>
292                 <th id="sellprice_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("sellprice")'> [%- 'Price'       | $T8 %]</a></th>
293                 <th id="discount_header_id"    class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("discount")'>  [%- 'Discount'    | $T8 %]</a></th>
294                 <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
295               </tr>
296             </thead>
297
298             [%- FOREACH item = SELF.order.items_sorted %]
299               [%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
300             [%- END %]
301
302           </table>
303         </div>
304
305       </td>
306     </tr>
307
308     <tr>
309     </tr>
310
311     <tr>
312       <td colspan="100%" width="100%">
313         <table width="100%">
314           <tr>
315             <td>
316               <table>
317                 <tr>
318                   <th align="left">[% 'Notes' | $T8 %]</th>
319                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
320                 </tr>
321                 <tr valign="top">
322                   <td>
323                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
324                   </td>
325                   <td>
326                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
327                   </td>
328                 </tr>
329               </table>
330             </td>
331
332             <td>
333               <table>
334                 <tr>
335                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
336                   <td>[% L.select_tag('order.payment_id',
337                                       SELF.all_payment_terms,
338                                       default = SELF.order.payment_id,
339                                       with_empty = 1,
340                                       title_key = 'description',
341                                       style = 'width: 250px') %]</td>
342                 </tr>
343                 <tr>
344                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
345                   <td>[% L.select_tag('order.delivery_term_id',
346                                       SELF.all_delivery_terms,
347                                       default = SELF.order.delivery_term_id,
348                                       with_empty = 1,
349                                       title_key = 'description',
350                                       style = 'width: 250px') %]</td>
351                 </tr>
352                 [%- IF SELF.type == "sales_order" %]
353                 <tr>
354                   <th align="right">[%- 'Periodic Invoices' | $T8 %]</th>
355                   <td>[% L.button_tag('kivi.Order.show_periodic_invoices_config_dialog()', LxERP.t8('Configure')) %]
356                     (<span id='periodic_invoices_status'>[%- SELF.periodic_invoices_status -%]</span>)
357                     <a href="doc/html/ch03.html#features.periodic-invoices.variables" target="_blank">?</a>
358                   </td>
359                 </tr>
360                 [%- END %]
361               </table>
362             </td>
363
364             [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
365             [%- SET marge_class = (SELF.order.marge_total < 0) ? 'plus0' : '' -%]
366             <td>
367               <table>
368                 <tr>
369                   <th  align="left">[% 'Ertrag' | $T8 %]</th>
370                   <td align="right">
371                     [%- L.div_tag(SELF.order.marge_total_as_number, id='marge_total_id', class=marge_class) %]
372                   </td>
373                 </tr>
374                 <tr>
375                   <th  align="left">[% 'Ertrag prozentual' | $T8 %]</th>
376                   <td align="right">
377                     [%- L.div_tag(LxERP.format_amount(SELF.order.marge_percent, 2), id='marge_percent_id', class=marge_class) %]
378                   </td>
379                   <td>[%- L.div_tag('%', id='marge_percent_sign_id', class=marge_class) %]</td>
380                 </tr>
381               </table>
382             </td>
383             [%- END %]
384
385             <td align="right">
386               <table>
387                 <tr id="taxincluded_row_id" [%- IF !SELF.taxes.size %]style="display:none"[%- END %]>
388                   <td align=right colspan="2">
389                     <label for="order.taxincluded"><b>[% 'Tax Included' | $T8 %]</b></label>
390                     [% L.yes_no_tag('order.taxincluded', SELF.order.taxincluded, class='recalc') %]
391                   </td>
392                 </tr>
393
394                 <tr id="subtotal_row_id" [%- IF SELF.order.taxincluded %]style="display:none"[%- END %]>
395                   <th align="right">[%- 'Subtotal' | $T8 %]</th>
396                   <td align="right">
397                     [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
398                   </td>
399                 </tr>
400                 [%- FOREACH tax = SELF.taxes %]
401                   [%- PROCESS order/tabs/_tax_row.html TAX=tax TAXINCLUDED=SELF.order.taxincluded %]
402                 [%- END %]
403                 <tr id="amount_row_id">
404                   <th align="right">[%- 'Total' | $T8 %]</th>
405                   <td align="right">
406                     [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
407                   </td>
408                 </tr>
409               </table>
410             </td>
411
412           </tr>
413         </table>
414       </td>
415     </tr>
416
417   </table>
418
419 </div>
420
421 [% L.sortable_element('#row_table_id') %]