]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/order/tabs/basic_data.html
kivitendo 3.9.2-0.2
[mfinanz.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, show_details="1",
19                    style='width: 300px') %]
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           [%- IF SELF.cv == "customer" %]
55           <tr id="billing_address_row"[% IF !SELF.order.customer.additional_billing_addresses.as_list.size %] style="display:none"[% END %]>
56             <th align="right">[% 'Custom Billing Address' | $T8 %]</th>
57             <td>
58               [% L.select_tag('order.billing_address_id',
59                                SELF.order.customer.additional_billing_addresses,
60                                default=SELF.order.billing_address_id,
61                                title_key='displayable_id',
62                                value_key='id',
63                                with_empty=1,
64                                style='width: 300px') %]
65             </td>
66           </tr>
67           [%- END %]
68
69           [%- PROCESS order/tabs/_business_info_row.html SELF=SELF %]
70
71           <tr>
72             <th align="right">[% 'Steuersatz' | $T8 %]</th>
73             <td>[% L.select_tag('order.taxzone_id', SELF.all_taxzones, default=SELF.order.taxzone_id, title_key='description', style='width: 300px', class='recalc') %]</td>
74           </tr>
75
76           [% SET currency_id = SELF.order.currency_id || INSTANCE_CONF.get_currency_id  # use default currency for new order %]
77           [% SET show_exchangerate = (SELF.order.currency_id !=INSTANCE_CONF.get_currency_id) %]
78           <tr id="currency_settings">
79             <th align="right">[% 'Currency' | $T8 %]</th>
80             <td>[% L.select_tag('order.currency_id', SELF.all_currencies, default=currency_id, value_key='id', title_key='name') %]</td>
81           </tr>
82           <tr id="exchangerate_settings" [%- IF !show_exchangerate %]style='display:none'[%- END %]>
83             <th align="right">[% 'Exchangerate' | $T8 %]</th>
84             <td> 1 <span id="currency_name">[% SELF.order.currency.name %]</span> =
85               [% L.input_tag('order.exchangerate_as_null_number', SELF.order.exchangerate_as_null_number, 'data-validate'=show_exchangerate ? 'required' : '', size="15", class="reformat_number_as_null_number numeric") %]
86               [% INSTANCE_CONF.default_currency %]
87               [% L.hidden_tag('old_currency_id', currency_id) %]
88               [% L.hidden_tag('old_exchangerate', SELF.order.exchangerate_as_null_number) %]
89             </td>
90           </tr>
91
92 [%- IF SELF.all_languages.size %]
93           <tr>
94             <th align="right">[% 'Language' | $T8 %]</th>
95             <td>
96               [% L.select_tag('order.language_id', SELF.all_languages, default=SELF.order.language_id, title_key='description', with_empty=1, style='width:300px') %]
97             </td>
98           </tr>
99 [%- END %]
100
101 [%- IF SELF.all_departments.size %]
102           <tr>
103             <th align="right">[% 'Department' | $T8 %]</th>
104             <td>
105               [% L.select_tag('order.department_id', SELF.all_departments, default=SELF.order.department_id, title_key='description', with_empty=1, style='width:300px') %]
106             </td>
107           </tr>
108 [%- END %]
109
110           <tr>
111             <th align="right">[% 'Shipping Point' | $T8 %]</th>
112             <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>
113           </tr>
114
115           <tr>
116             <th align="right">[% 'Ship via' | $T8 %]</th>
117             <td>[% L.input_tag('order.shipvia', SELF.order.shipvia, style='width: 300px') %]</td>
118           </tr>
119
120           <tr>
121             <th align="right">[% 'Transaction description' | $T8 %]</th>
122             <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>
123           </tr>
124
125           <tr>
126             <th align="right">[% 'Project Number' | $T8 %]</th>
127             <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
128           </tr>
129
130         </table>
131       </td>
132
133       <td align="right">
134         <table>
135
136           <tr>
137             <td colspan="2" align="center">
138               [%- IF SELF.order.id %]
139                 <label for="order.delivered">[% 'Delivery Order(s) for full qty created' | $T8 %]</label>
140                 [% L.yes_no_tag('order.delivered', SELF.order.delivered) %]
141                 <label for="order.closed">[% 'Closed' | $T8 %]</label>
142                 [% L.yes_no_tag('order.closed', SELF.order.closed) %]
143               [%- END %]
144             </td>
145           </tr>
146
147           [%- IF SELF.all_statuses.size %]
148           <tr>
149             <th align="right">[% 'Status' | $T8 %]</th>
150             <td>[% L.select_tag('order.order_status_id',
151               SELF.all_statuses,
152               default=SELF.order.order_status_id,
153               with_empty=1,
154               style='width:100%',
155               title_key='name') %]</td>
156           </tr>
157           [%- END -%]
158
159           <tr>
160             <th align="right">[% 'Employee' | $T8 %]</th>
161             <td>[% L.select_tag('order.employee_id',
162               SELF.all_employees,
163               default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
164               style='width:100%',
165               title_key='safe_name') %]</td>
166           </tr>
167
168           [% IF SELF.cv == 'customer' %]
169           <tr>
170             <th align="right">[% 'Salesman' | $T8 %]</th>
171             <td>[% L.select_tag('order.salesman_id',
172               SELF.all_salesmen,
173               default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
174               style='width:100%',
175               title_key='safe_name') %]</td>
176           </tr>
177           [% END %]
178
179           [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") -%]
180           <tr>
181             <th width="70%" align="right" nowrap>[% IF SELF.type == "purchase_order_confirmation" %][% 'Order Confirmation Number' | $T8 %][% ELSE %][% 'Order Number' | $T8 %][% END %]</th>
182             <td>
183               [%- IF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
184                 [% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]
185               [%- ELSIF SELF.order.id %]
186                 [% HTML.escape(SELF.order.ordnumber) %]
187                 [% L.hidden_tag("order.ordnumber", SELF.order.ordnumber) %]
188               [% ELSE %]
189                 [% LxERP.t8("will be set upon saving") %]
190               [%- END %]
191             </td>
192           </tr>
193           [%- END -%]
194
195           [% IF SELF.type == "purchase_order_confirmation" %]
196           <tr>
197             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
198             [%-
199               numbers = [];
200               FOREACH p = SELF.order.preceding_purchase_orders();
201                 numbers.push(HTML.escape(p.ordnumber));
202               END;
203               %]
204             <td>[% numbers.join(', ') %]</td>
205           </tr>
206           [% END %]
207
208           [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "sales_quotation" || SELF.type == "purchase_quotation_intake") -%]
209             [%- SET quo_nr_txt = 'Quotation Number' -%]
210           [%- ELSE -%]
211             [%- SET quo_nr_txt = 'RFQ Number' -%]
212           [%- END -%]
213           <tr>
214             <th width="70%" align="right" nowrap>[% quo_nr_txt | $T8 %]</th>
215             <td>
216               [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") -%]
217                 [% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11) %]
218               [%- ELSIF INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
219                 [% L.input_tag('order.quonumber', SELF.order.quonumber, size = 11, onchange='kivi.Order.set_number_in_title(this)') %]
220               [%- ELSIF SELF.order.id %]
221                 [% HTML.escape(SELF.order.quonumber) %]
222                 [% L.hidden_tag("order.quonumber", SELF.order.quonumber) %]
223               [% ELSE %]
224                 [% LxERP.t8("will be set upon saving") %]
225               [%- END %]
226             </td>
227           </tr>
228
229           [%- IF (SELF.type == "purchase_order_confirmation") -%]
230           <tr>
231             <th width="70%" align="right" nowrap>[% 'Vendor Confirmation Number' | $T8 %]</th>
232             <td>[% L.input_tag('order.vendor_confirmation_number', SELF.order.vendor_confirmation_number, size = 11) %]</td>
233           </tr>
234           [%- END -%]
235
236           [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") -%]
237           <tr>
238             <th width="70%" align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
239             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
240           </tr>
241           [%- END -%]
242
243           [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
244             [%- SET transdate_txt = 'Order Date' -%]
245           [%- ELSIF SELF.type == "purchase_order_confirmation" -%]
246             [%- SET transdate_txt = 'Confirmation Date' -%]
247           [%- ELSIF (SELF.type == "sales_quotation" || SELF.type == "purchase_quotation_intake") -%]
248             [%- SET transdate_txt = 'Quotation Date' -%]
249           [%- ELSE -%]
250             [%- SET transdate_txt = 'RFQ Date' -%]
251           [%- END -%]
252           <tr>
253             <th width="70%" align="right" nowrap>[% transdate_txt | $T8 %]</th>
254             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
255           </tr>
256
257           <tr>
258             <th width="70%" align="right" nowrap>[% 'Tax point' | $T8 %]</th>
259             <td>[% L.date_tag('order.tax_point_as_date', SELF.order.tax_point_as_date, class="recalc") %]</td>
260           </tr>
261
262           [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") -%]
263             [%- SET reqdate_txt = 'Reqdate'; SET reqdate_class = 'recalc' -%]
264           [%- ELSIF SELF.type == "sales_quotation" -%]
265             [%- SET reqdate_txt = 'Valid until'; SET reqdate_class = '' -%]
266           [%- ELSE -%]
267             [%- SET reqdate_txt = 'Required by'; SET reqdate_class = 'recalc' -%]
268           [%- END -%]
269           <tr>
270             <th width="70%" align="right" nowrap>[% reqdate_txt | $T8 %]</th>
271             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
272           </tr>
273
274           [%- IF SELF.type == "sales_quotation" -%]
275           <tr>
276             <th width="70%" align="right" nowrap>[% 'Order probability' | $T8 %]</th>
277             <td>[%- L.select_tag('order.order_probability', SELF.order_probabilities, title='title', default=SELF.order.order_probability) %]%</td>
278           </tr>
279           <tr>
280             <th width="70%" align="right" nowrap>[% 'Expected billing date' | $T8 %]</th>
281             <td>[%- L.date_tag('order.expected_billing_date_as_date', SELF.order.expected_billing_date_as_date) %]</td>
282           </tr>
283           [%- END %]
284
285           <tr>
286             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
287             <td>[% SELF.order.itime_as_date %]</td>
288           </tr>
289
290         </table>
291
292       </td>
293     </tr>
294   </table>
295
296   [%- IF order_item_input_position == 0 -%]
297   [%- PROCESS order/tabs/_item_input.html SELF=SELF %]
298
299   [% L.button_tag('kivi.Order.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
300   [%- END -%]
301
302   <table width="100%">
303     <tr>
304       <td>
305         [%- IF SELF.positions_scrollbar_height -%]
306           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
307         [%- ELSE -%]
308           [%- SET scroll_style = '' -%]
309         [%- END -%]
310         <div id="row_table_scroll_id" [%- scroll_style -%]>
311           <table id="row_table_id" width="100%">
312             <thead>
313               <tr class="listheading">
314                 <th class="listheading" style='text-align:center' nowrap width="1">
315                   [%- IF MYCONFIG.show_form_details %]
316                     [%- 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") %]
317                   [%- ELSE %]
318                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
319                   [%- END %]
320                 </th>
321                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
322                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
323                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
324                 [%- IF SELF.show_update_button -%]
325                 <th class="listheading" style='text-align:center' nowrap width="1">
326                   [%- L.img_tag(src="image/rotate_cw.svg",
327                                 alt=LxERP.t8('Update from master data'),
328                                 title= LxERP.t8('Update from master data'),
329                                 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();",
330                                 id='update_from_master') %]
331                 </th>
332                 [%- END %]
333                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Order.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
334                 [%- IF SELF.search_cvpartnumber -%]
335                 <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>
336                 [%- END -%]
337                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
338                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.Order.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
339                 [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") -%]
340                 <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>
341                 [%- END -%]
342                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Order.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
343                 <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
344                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
345                 <th class="listheading" nowrap width="5" >[%- 'Price Source' | $T8 %] </th>
346                 <th id="sellprice_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("sellprice")'> [%- 'Price'       | $T8 %]</a></th>
347                 <th id="discount_header_id"    class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Order.reorder_items("discount")'>  [%- 'Discount'    | $T8 %]</a></th>
348                 <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
349               </tr>
350             </thead>
351
352             [%- FOREACH item = SELF.order.items_sorted %]
353               [%- PROCESS order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
354             [%- END %]
355
356             <tbody id="row_table_footer" class="listrow">
357             [% IF order_item_input_position == 1 %]
358               [%- PROCESS order/tabs/_item_below_input.html SELF=SELF %]
359             [%- END -%]
360             </tbody>
361
362           </table>
363           [% IF order_item_input_position == 1 %]
364             [% L.button_tag('kivi.Order.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
365           [%- END -%]
366         </div>
367       </td>
368     </tr>
369
370     <tr>
371       <td>
372       </td>
373     </tr>
374
375     <tr>
376       <td colspan="100%" width="100%">
377         <table width="100%">
378           <tr>
379             <td>
380               <table>
381                 <tr>
382                   <th align="left">[% 'Notes' | $T8 %]</th>
383                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
384                 </tr>
385                 <tr valign="top">
386                   <td>
387                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
388                   </td>
389                   <td>
390                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
391                   </td>
392                 </tr>
393               </table>
394             </td>
395
396             <td>
397               <table>
398                 <tr>
399                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
400                   <td>[% L.select_tag('order.payment_id',
401                                       SELF.all_payment_terms,
402                                       default = SELF.order.payment_id,
403                                       with_empty = 1,
404                                       title_key = 'description',
405                                       style = 'width: 250px') %]</td>
406                 </tr>
407                 <tr>
408                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
409                   <td>[% L.select_tag('order.delivery_term_id',
410                                       SELF.all_delivery_terms,
411                                       default = SELF.order.delivery_term_id,
412                                       with_empty = 1,
413                                       title_key = 'description',
414                                       style = 'width: 250px') %]</td>
415                 </tr>
416                 [%- IF SELF.type == "sales_order" %]
417                 <tr>
418                   <th align="right">[%- 'Periodic Invoices' | $T8 %]</th>
419                   <td>[% L.button_tag('kivi.Order.show_periodic_invoices_config_dialog()', LxERP.t8('Configure')) %]
420                     (<span id='periodic_invoices_status'>[%- SELF.periodic_invoices_status -%]</span>)
421                     <a href="doc/html/ch03.html#features.periodic-invoices.variables" target="_blank">?</a>
422                   </td>
423                 </tr>
424                 [%- END %]
425               </table>
426             </td>
427
428             [%- IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
429             [%- SET marge_class = ((SELF.order.marge_total || 0) < 0) ? 'plus0' : '' -%]
430             <td>
431               <table>
432                 <tr>
433                   <th  align="left">[% 'Ertrag' | $T8 %]</th>
434                   <td align="right">
435                     [%- L.div_tag(SELF.order.marge_total_as_number, id='marge_total_id', class=marge_class) %]
436                   </td>
437                 </tr>
438                 <tr>
439                   <th  align="left">[% 'Ertrag prozentual' | $T8 %]</th>
440                   <td align="right">
441                     [%- L.div_tag(LxERP.format_amount(SELF.order.marge_percent, 2), id='marge_percent_id', class=marge_class) %]
442                   </td>
443                   <td>[%- L.div_tag('%', id='marge_percent_sign_id', class=marge_class) %]</td>
444                 </tr>
445               </table>
446             </td>
447             [%- END %]
448
449             <td align="right">
450               <table>
451                 <tr id="taxincluded_row_id" [%- IF !SELF.taxes.size %]style="display:none"[%- END %]>
452                   <td align=right colspan="2">
453                     <label for="order.taxincluded"><b>[% 'Tax Included' | $T8 %]</b></label>
454                     [% L.yes_no_tag('order.taxincluded', SELF.order.taxincluded, class='recalc') %]
455                   </td>
456                 </tr>
457
458                 <tr id="subtotal_row_id" [%- IF SELF.order.taxincluded %]style="display:none"[%- END %]>
459                   <th align="right">[%- 'Subtotal' | $T8 %]</th>
460                   <td align="right">
461                     [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
462                   </td>
463                 </tr>
464                 [%- FOREACH tax = SELF.taxes %]
465                   [%- PROCESS order/tabs/_tax_row.html TAX=tax TAXINCLUDED=SELF.order.taxincluded %]
466                 [%- END %]
467                 <tr id="amount_row_id">
468                   <th align="right">[%- 'Total' | $T8 %]</th>
469                   <td align="right">
470                     [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
471                   </td>
472                 </tr>
473               </table>
474             </td>
475
476           </tr>
477         </table>
478       </td>
479     </tr>
480
481   </table>
482
483 </div>
484
485 [% L.sortable_element('#row_table_id') %]