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