c413fb92fb501e4d5b26e3f6d27342a6401cbeec
[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                    L.select_tag('order.shipto_id',
40                                  shiptos.import(SELF.order.${SELF.cv}.shipto),
41                                  default=SELF.order.shipto_id,
42                                  title_key='displayable_id',
43                                  value_key='shipto_id',
44                                  with_empty=0,
45                                  style='width: 300px') %]
46               </span>
47               [% L.button_tag("kivi.Order.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
48             </td>
49           </tr>
50
51           [%- PROCESS order/tabs/_business_info_row.html SELF=SELF %]
52
53           <tr>
54             <th align="right">[% 'Steuersatz' | $T8 %]</th>
55             <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>
56           </tr>
57
58           [% SET currency_id = SELF.order.currency_id || INSTANCE_CONF.get_currency_id  # use default currency for new order %]
59           <tr id="currency_settings">
60             <th align="right">[% 'Currency' | $T8 %]</th>
61             <td>[% L.select_tag('order.currency_id', SELF.all_currencies, default=currency_id, value_key='id', title_key='name') %]</td>
62           </tr>
63           <tr id="exchangerate_settings" [%- IF SELF.order.currency_id==INSTANCE_CONF.get_currency_id %]style='display:none'[%- END %]>
64             <th align="right">[% 'Exchangerate' | $T8 %]</th>
65             <td> 1 <span id="currency_name">[% SELF.order.currency.name %]</span> =
66               [% L.input_tag('order.exchangerate_as_null_number', SELF.order.exchangerate_as_null_number, size="15", class="reformat_number_as_null_number numeric") %]
67               [% INSTANCE_CONF.default_currency %]
68               [% L.hidden_tag('old_currency_id', currency_id) %]
69               [% L.hidden_tag('old_exchangerate', SELF.order.exchangerate_as_null_number) %]
70             </td>
71           </tr>
72
73 [%- IF SELF.all_departments.size %]
74           <tr>
75             <th align="right">[% 'Department' | $T8 %]</th>
76             <td>
77               [% L.select_tag('order.department_id', SELF.all_departments, default=SELF.order.department_id, title_key='description', with_empty=1, style='width:300px') %]
78             </td>
79           </tr>
80 [%- END %]
81
82           <tr>
83             <th align="right">[% 'Shipping Point' | $T8 %]</th>
84             <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>
85           </tr>
86
87           <tr>
88             <th align="right">[% 'Ship via' | $T8 %]</th>
89             <td>[% L.input_tag('order.shipvia', SELF.order.shipvia, style='width: 300px') %]</td>
90           </tr>
91
92           <tr>
93             <th align="right">[% 'Transaction description' | $T8 %]</th>
94             <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>
95           </tr>
96
97           <tr>
98             <th align="right">[% 'Project Number' | $T8 %]</th>
99             <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
100           </tr>
101
102         </table>
103       </td>
104
105       <td align="right">
106         <table>
107
108           <tr>
109             <td colspan="2" align="center">
110               [%- IF SELF.order.id %]
111                 <label for="order.delivered">[% 'Delivery Order(s) for full qty created' | $T8 %]</label>
112                 [% L.yes_no_tag('order.delivered', SELF.order.delivered) %]
113                 <label for="order.closed">[% 'Closed' | $T8 %]</label>
114                 [% L.yes_no_tag('order.closed', SELF.order.closed) %]
115               [%- END %]
116             </td>
117           </tr>
118
119           <tr>
120             <th align="right">[% 'Employee' | $T8 %]</th>
121             <td>[% L.select_tag('order.employee_id',
122               SELF.all_employees,
123               default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
124               title_key='safe_name') %]</td>
125           </tr>
126
127           [% IF SELF.cv == 'customer' %]
128           <tr>
129             <th align="right">[% 'Salesman' | $T8 %]</th>
130             <td>[% L.select_tag('order.salesman_id',
131               SELF.all_salesmen,
132               default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
133               title_key='safe_name') %]</td>
134           </tr>
135           [% END %]
136
137           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
138           <tr>
139             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
140             <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]</td>
141           </tr>
142           [%- END -%]
143
144           [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
145             [%- SET quo_nr_txt = 'Quotation Number' -%]
146           [%- ELSE -%]
147             [%- SET quo_nr_txt = 'RFQ Number' -%]
148           [%- END -%]
149           <tr>
150             <th width="70%" align="right" nowrap>[% quo_nr_txt | $T8 %]</th>
151             [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
152               <td>[% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11) %]</td>
153             [%- ELSE -%]
154               <td>[% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]</td>
155             [%- END -%]
156           </tr>
157
158           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
159           <tr>
160             <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
161             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
162           </tr>
163           [%- END -%]
164
165           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
166             [%- SET transdate_txt = 'Order Date' -%]
167           [%- ELSIF SELF.type == "sales_quotation" -%]
168             [%- SET transdate_txt = 'Quotation Date' -%]
169           [%- ELSE -%]
170             [%- SET transdate_txt = 'RFQ Date' -%]
171           [%- END -%]
172           <tr>
173             <th width="70%" align="right" nowrap>[% transdate_txt | $T8 %]</th>
174             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
175           </tr>
176
177           [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
178             [%- SET reqdate_txt = 'Reqdate' -%]
179           [%- ELSIF SELF.type == "sales_quotation" -%]
180             [%- SET reqdate_txt = 'Valid until' -%]
181           [%- ELSE -%]
182             [%- SET reqdate_txt = 'Required by' -%]
183           [%- END -%]
184           <tr>
185             <th width="70%" align="right" nowrap>[% reqdate_txt | $T8 %]</th>
186             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date) %]</td>
187           </tr>
188
189           [%- IF SELF.type == "sales_quotation" -%]
190           <tr>
191             <th width="70%" align="right" nowrap>[% 'Order probability' | $T8 %]</th>
192             <td>[%- L.select_tag('order.order_probability', SELF.order_probabilities, title='title', default=SELF.order.order_probability) %]%</td>
193           </tr>
194           <tr>
195             <th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th>
196             <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_sa_date) %]</td>
197           </tr>
198           [%- END %]
199
200           <tr>
201             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
202             <td>[% SELF.order.itime_as_date %]</td>
203           </tr>
204
205         </table>
206
207       </td>
208     </tr>
209   </table>
210
211   [%- PROCESS order/tabs/_item_input.html SELF=SELF %]
212
213   [% L.button_tag('kivi.Order.show_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
214
215   <table width="100%">
216     <tr>
217       <td>
218         [%- IF SELF.positions_scrollbar_height -%]
219           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
220         [%- ELSE -%]
221           [%- SET scroll_style = '' -%]
222         [%- END -%]
223         <div id="row_table_scroll_id" [%- scroll_style -%]>
224           <table id="row_table_id" width="100%">
225             <thead>
226               <tr class="listheading">
227                 <th class="listheading" style='text-align:center' nowrap width="1">
228                   [%- IF MYCONFIG.show_form_details %]
229                     [%- 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") %]
230                   [%- ELSE %]
231                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
232                   [%- END %]
233                 </th>
234                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
235                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
236                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
237                 [%- IF SELF.show_update_button -%]
238                 <th class="listheading" style='text-align:center' nowrap width="1">
239                   [%- L.img_tag(src="image/rotate_cw.svg",
240                                 alt=LxERP.t8('Update from master data'),
241                                 title= LxERP.t8('Update from master data'),
242                                 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();",
243                                 id='update_from_master') %]
244                 </th>
245                 [%- END %]
246                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
247                 [%- IF SELF.search_cvpartnumber -%]
248                 <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>
249                 [%- END -%]
250                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
251                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.Order.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
252                 [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
253                 <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>
254                 [%- END -%]
255                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Order.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
256                 <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
257                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
258                 <th class="listheading" nowrap width="5" >[%- 'Price Source' | $T8 %] </th>
259                 <th id="sellprice_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("sellprice")'> [%- 'Price'       | $T8 %]</a></th>
260                 <th id="discount_header_id"    class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("discount")'>  [%- 'Discount'    | $T8 %]</a></th>
261                 <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
262               </tr>
263             </thead>
264
265             [%- FOREACH item = SELF.order.items_sorted %]
266               [%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
267             [%- END %]
268
269           </table>
270         </div>
271
272       </td>
273     </tr>
274
275     <tr>
276     </tr>
277
278     <tr>
279       <td colspan="100%" width="100%">
280         <table width="100%">
281           <tr>
282             <td>
283               <table>
284                 <tr>
285                   <th align="left">[% 'Notes' | $T8 %]</th>
286                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
287                 </tr>
288                 <tr valign="top">
289                   <td>
290                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
291                   </td>
292                   <td>
293                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
294                   </td>
295                 </tr>
296               </table>
297             </td>
298
299             <td>
300               <table>
301                 <tr>
302                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
303                   <td>[% L.select_tag('order.payment_id',
304                                       SELF.all_payment_terms,
305                                       default = SELF.order.payment_id,
306                                       with_empty = 1,
307                                       title_key = 'description',
308                                       style = 'width: 250px') %]</td>
309                 </tr>
310                 <tr>
311                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
312                   <td>[% L.select_tag('order.delivery_term_id',
313                                       SELF.all_delivery_terms,
314                                       default = SELF.order.delivery_term_id,
315                                       with_empty = 1,
316                                       title_key = 'description',
317                                       style = 'width: 250px') %]</td>
318                 </tr>
319                 [%- IF SELF.type == "sales_order" %]
320                 <tr>
321                   <th align="right">[%- 'Periodic Invoices' | $T8 %]</th>
322                   <td>[% L.button_tag('kivi.Order.show_periodic_invoices_config_dialog()', LxERP.t8('Configure')) %]
323                     (<span id='periodic_invoices_status'>[%- SELF.periodic_invoices_status -%]</span>)
324                     <a href="doc/html/ch03.html#features.periodic-invoices.variables" target="_blank">?</a>
325                   </td>
326                 </tr>
327                 [%- END %]
328               </table>
329             </td>
330
331             [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
332             [%- SET marge_class = (SELF.order.marge_total < 0) ? 'plus0' : '' -%]
333             <td>
334               <table>
335                 <tr>
336                   <th  align="left">[% 'Ertrag' | $T8 %]</th>
337                   <td align="right">
338                     [%- L.div_tag(SELF.order.marge_total_as_number, id='marge_total_id', class=marge_class) %]
339                   </td>
340                 </tr>
341                 <tr>
342                   <th  align="left">[% 'Ertrag prozentual' | $T8 %]</th>
343                   <td align="right">
344                     [%- L.div_tag(LxERP.format_amount(SELF.order.marge_percent, 2), id='marge_percent_id', class=marge_class) %]
345                   </td>
346                   <td>[%- L.div_tag('%', id='marge_percent_sign_id', class=marge_class) %]</td>
347                 </tr>
348               </table>
349             </td>
350             [%- END %]
351
352             <td align="right">
353               <table>
354                 <tr id="taxincluded_row_id" [%- IF !SELF.taxes.size %]style="display:none"[%- END %]>
355                   <td align=right colspan="2">
356                     <label for="order.taxincluded"><b>[% 'Tax Included' | $T8 %]</b></label>
357                     [% L.yes_no_tag('order.taxincluded', SELF.order.taxincluded, class='recalc') %]
358                   </td>
359                 </tr>
360
361                 <tr id="subtotal_row_id" [%- IF SELF.order.taxincluded %]style="display:none"[%- END %]>
362                   <th align="right">[%- 'Subtotal' | $T8 %]</th>
363                   <td align="right">
364                     [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
365                   </td>
366                 </tr>
367                 [%- FOREACH tax = SELF.taxes %]
368                   [%- PROCESS order/tabs/_tax_row.html TAX=tax TAXINCLUDED=SELF.order.taxincluded %]
369                 [%- END %]
370                 <tr id="amount_row_id">
371                   <th align="right">[%- 'Total' | $T8 %]</th>
372                   <td align="right">
373                     [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
374                   </td>
375                 </tr>
376               </table>
377             </td>
378
379           </tr>
380         </table>
381       </td>
382     </tr>
383
384   </table>
385
386 </div>
387
388 [% L.sortable_element('#row_table_id') %]