15cc83af46566f7fff23adcf2f30821ed393531c
[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.DeliveryOrder.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.DeliveryOrder.edit_custom_shipto()", LxERP.t8("Custom shipto")) %]
51             </td>
52           </tr>
53
54           [%- PROCESS delivery_order/tabs/_business_info_row.html SELF=SELF %]
55
56 [%- IF SELF.all_languages.size %]
57           <tr>
58             <th align="right">[% 'Language' | $T8 %]</th>
59             <td>
60               [% L.select_tag('order.language_id', SELF.all_languages, default=SELF.order.language_id, title_key='description', with_empty=1, style='width:300px') %]
61             </td>
62           </tr>
63 [%- END %]
64
65 [%- IF SELF.all_departments.size %]
66           <tr>
67             <th align="right">[% 'Department' | $T8 %]</th>
68             <td>
69               [% L.select_tag('order.department_id', SELF.all_departments, default=SELF.order.department_id, title_key='description', with_empty=1, style='width:300px') %]
70             </td>
71           </tr>
72 [%- END %]
73
74           <tr>
75             <th align="right">[% 'Shipping Point' | $T8 %]</th>
76             <td>[% L.input_tag('order.shippingpoint', SELF.order.shippingpoint, style='width: 300px') %]</td>
77           </tr>
78
79           <tr>
80             <th align="right">[% 'Ship via' | $T8 %]</th>
81             <td>[% L.input_tag('order.shipvia', SELF.order.shipvia, style='width: 300px') %]</td>
82           </tr>
83
84           <tr>
85             <th align="right">[% 'Transaction description' | $T8 %]</th>
86             <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>
87           </tr>
88
89           <tr>
90             <th align="right">[% 'Project Number' | $T8 %]</th>
91             <td>[% P.project.picker('order.globalproject_id', SELF.order.globalproject_id, style='width: 300px') %]</td>
92           </tr>
93
94         </table>
95       </td>
96
97       <td align="right">
98         <table>
99
100           <tr>
101             <td colspan="2" align="center">
102               [%- IF SELF.order.id %]
103                 [%- IF SELF.order.delivered %]
104                   [%- IF is_customer %]
105                   [% 'transferred out' | $T8 %]
106                   [%- ELSE %]
107                   [% 'transferred in' | $T8 %]
108                   [%- END %]
109                 [%- ELSE %]
110                   [%- IF is_customer %]
111                   [% 'not transferred out yet' | $T8 %]
112                   [%- ELSE %]
113                   [% 'not transferred in yet' | $T8 %]
114                   [%- END %]
115                 [%- END %]
116                ;
117                 [%- IF SEF.order.closed %]
118                   [% 'Closed' | $T8 %]
119                 [%- ELSE %]
120                   [% 'Open' | $T8 %]
121                 [%- END %]
122               [%- END %]
123             </td>
124           </tr>
125
126           <tr>
127             <th align="right">[% 'Employee' | $T8 %]</th>
128             <td>[% L.select_tag('order.employee_id',
129               SELF.all_employees,
130               default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
131               title_key='safe_name') %]</td>
132           </tr>
133
134           [% IF SELF.cv == 'customer' %]
135           <tr>
136             <th align="right">[% 'Salesman' | $T8 %]</th>
137             <td>[% L.select_tag('order.salesman_id',
138               SELF.all_salesmen,
139               default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
140               title_key='safe_name') %]</td>
141           </tr>
142           [% END %]
143
144           <tr>
145             <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
146             <td>[% L.input_tag('order.donumber', SELF.order.donumber, size = 11, onchange='kivi.DeliveryOrder.set_number_in_title(this)') %]</td>
147           </tr>
148
149           <tr>
150             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
151             <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11) %]</td>
152           </tr>
153
154           <tr>
155             <th width="70%" align="right" nowrap>[% IF SELF.type_data.properties('is_customer') %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
156             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
157           </tr>
158
159           <tr>
160             <th width="70%" align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
161             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
162           </tr>
163
164           <tr>
165             <th width="70%" align="right" nowrap>[% 'Reqdate' | $T8 %]</th>
166             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
167           </tr>
168
169           <tr>
170             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
171             <td>[% SELF.order.itime_as_date %]</td>
172           </tr>
173         </table>
174
175       </td>
176     </tr>
177   </table>
178
179   [%- PROCESS delivery_order/tabs/_item_input.html SELF=SELF %]
180
181   [% L.button_tag('kivi.DeliveryOrder.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
182
183   <table width="100%">
184     <tr>
185       <td>
186         [%- IF SELF.positions_scrollbar_height -%]
187           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
188         [%- ELSE -%]
189           [%- SET scroll_style = '' -%]
190         [%- END -%]
191         <div id="row_table_scroll_id" [%- scroll_style -%]>
192           <table id="row_table_id" width="100%">
193             <thead>
194               <tr class="listheading">
195                 <th class="listheading" style='text-align:center' nowrap width="1">
196                   [%- IF MYCONFIG.show_form_details %]
197                     [%- 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") %]
198                   [%- ELSE %]
199                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
200                   [%- END %]
201                 </th>
202                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
203                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
204                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
205                 [%- IF SELF.show_update_button -%]
206                 <th class="listheading" style='text-align:center' nowrap width="1">
207                   [%- L.img_tag(src="image/rotate_cw.svg",
208                                 alt=LxERP.t8('Update from master data'),
209                                 title= LxERP.t8('Update from master data'),
210                                 onclick="if (!confirm('" _ LxERP.t8("Are you sure to update all positions from master data?") _ "')) return false; kivi.DeliveryOrder.update_all_rows_from_master_data();",
211                                 id='update_from_master') %]
212                 </th>
213                 [%- END %]
214                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
215                 [%- IF SELF.search_cvpartnumber -%]
216                 <th id="cvpartnumber_header_id" class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("cvpartnumber")' > [%- SELF.cv == "customer" ? LxERP.t8('Customer Part Number') : LxERP.t8('Model') %]</a></th>
217                 [%- END -%]
218                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
219                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
220                 [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
221                 <th id="shipped_qty_header_id"  class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("shipped_qty")'>[%- 'Delivered'   | $T8 %]</a></th>
222                 [%- END -%]
223                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
224                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
225               </tr>
226             </thead>
227
228             [%- FOREACH item = SELF.order.items_sorted %]
229               [%- PROCESS delivery_order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
230             [%- END %]
231
232           </table>
233         </div>
234
235       </td>
236     </tr>
237
238     <tr>
239     </tr>
240
241     <tr>
242       <td colspan="100%" width="100%">
243         <table width="100%">
244           <tr>
245             <td>
246               <table>
247                 <tr>
248                   <th align="left">[% 'Notes' | $T8 %]</th>
249                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
250                 </tr>
251                 <tr valign="top">
252                   <td>
253                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
254                   </td>
255                   <td>
256                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
257                   </td>
258                 </tr>
259               </table>
260             </td>
261
262             <td>
263               <table>
264                 <tr>
265                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
266                   <td>[% L.select_tag('order.payment_id',
267                                       SELF.all_payment_terms,
268                                       default = SELF.order.payment_id,
269                                       with_empty = 1,
270                                       title_key = 'description',
271                                       style = 'width: 250px') %]</td>
272                 </tr>
273                 <tr>
274                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
275                   <td>[% L.select_tag('order.delivery_term_id',
276                                       SELF.all_delivery_terms,
277                                       default = SELF.order.delivery_term_id,
278                                       with_empty = 1,
279                                       title_key = 'description',
280                                       style = 'width: 250px') %]</td>
281                 </tr>
282               </table>
283             </td>
284
285           </tr>
286         </table>
287       </td>
288     </tr>
289
290   </table>
291
292 </div>
293
294 [% L.sortable_element('#row_table_id') %]