Merge branch 'test' of ../kivitendo-erp_20220811
[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" id="data-status-line">[% SELF.order.presenter.status_line %]</td>
102           </tr>
103
104           <tr>
105             <th align="right">[% 'Employee' | $T8 %]</th>
106             <td>[% L.select_tag('order.employee_id',
107               SELF.all_employees,
108               default=(SELF.order.employee_id ? SELF.order.employee_id : SELF.current_employee_id),
109               title_key='safe_name') %]</td>
110           </tr>
111
112           [% IF SELF.cv == 'customer' %]
113           <tr>
114             <th align="right">[% 'Salesman' | $T8 %]</th>
115             <td>[% L.select_tag('order.salesman_id',
116               SELF.all_salesmen,
117               default=(SELF.order.salesman_id ? SELF.order.salesman_id : SELF.current_employee_id),
118               title_key='safe_name') %]</td>
119           </tr>
120           [% END %]
121
122           <tr>
123             <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
124             <td>[% L.input_tag('order.donumber', SELF.order.donumber, size = 11, onchange='kivi.DeliveryOrder.set_number_in_title(this)') %]</td>
125           </tr>
126
127           <tr>
128             <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
129             <td>[% L.input_tag('order.ordnumber', SELF.order.ordnumber, size = 11) %]</td>
130           </tr>
131
132           <tr>
133             <th width="70%" align="right" nowrap>[% IF SELF.type_data.properties('is_customer') %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
134             <td>[% L.input_tag('order.cusordnumber', SELF.order.cusordnumber, size = 11) %]</td>
135           </tr>
136
137           <tr>
138             <th width="70%" align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
139             <td>[% L.date_tag('order.transdate_as_date', SELF.order.transdate_as_date) %]</td>
140           </tr>
141
142           <tr>
143             <th width="70%" align="right" nowrap>[% 'Reqdate' | $T8 %]</th>
144             <td>[% L.date_tag('order.reqdate_as_date', SELF.order.reqdate_as_date, class=reqdate_class) %]</td>
145           </tr>
146
147           <tr>
148             <th width="70%" align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
149             <td>[% SELF.order.itime_as_date %]</td>
150           </tr>
151         </table>
152
153       </td>
154     </tr>
155   </table>
156
157   [%- PROCESS delivery_order/tabs/_item_input.html SELF=SELF %]
158
159   [% L.button_tag('kivi.DeliveryOrder.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %]
160
161   <table width="100%">
162     <tr>
163       <td>
164         [%- IF SELF.positions_scrollbar_height -%]
165           [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
166         [%- ELSE -%]
167           [%- SET scroll_style = '' -%]
168         [%- END -%]
169         <div id="row_table_scroll_id" [%- scroll_style -%]>
170           <table id="row_table_id" width="100%">
171             <thead>
172               <tr class="listheading">
173                 <th class="listheading" style='text-align:center' nowrap width="1">
174                   [%- IF MYCONFIG.show_form_details %]
175                     [%- 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") %]
176                   [%- ELSE %]
177                     [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all') %]
178                   [%- END %]
179                 </th>
180                 <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
181                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
182                 <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
183                 [%- IF SELF.show_update_button -%]
184                 <th class="listheading" style='text-align:center' nowrap width="1">
185                   [%- L.img_tag(src="image/rotate_cw.svg",
186                                 alt=LxERP.t8('Update from master data'),
187                                 title= LxERP.t8('Update from master data'),
188                                 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();",
189                                 id='update_from_master') %]
190                 </th>
191                 [%- END %]
192                 <th id="partnumber_header_id"   class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
193                 [%- IF SELF.search_cvpartnumber -%]
194                 <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>
195                 [%- END -%]
196                 <th id="partclass_header_id"    class="listheading" nowrap width="2">[%- 'Type'  | $T8 %]</th>
197                 <th id="description_header_id"  class="listheading" nowrap           ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
198                 [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
199                 <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>
200                 [%- END -%]
201                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
202                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
203                 [% IF in_out == 'in' %]
204                 <th class="listheading" nowrap width="5" >[%- 'Transfer To Stock' | $T8 %] </th>
205                 [% END %]
206                 [% IF in_out == 'out' %]
207                 <th class="listheading" nowrap width="5" >[%- 'Release From Stock' | $T8 %] </th>
208                 [% END %]
209               </tr>
210             </thead>
211
212             [%- FOREACH item = SELF.order.items_sorted %]
213               [%- PROCESS delivery_order/tabs/_row.html ITEM=item ID=(item.id||item.new_fake_id)  -%]
214             [%- END %]
215
216           </table>
217         </div>
218
219       </td>
220     </tr>
221
222     <tr>
223     </tr>
224
225     <tr>
226       <td colspan="100%" width="100%">
227         <table width="100%">
228           <tr>
229             <td>
230               <table>
231                 <tr>
232                   <th align="left">[% 'Notes' | $T8 %]</th>
233                   <th align="left">[% 'Internal Notes' | $T8 %]</th>
234                 </tr>
235                 <tr valign="top">
236                   <td>
237                     [% L.textarea_tag('order.notes', SELF.order.notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
238                   </td>
239                   <td>
240                     [% L.textarea_tag('order.intnotes', SELF.order.intnotes, wrap="soft", style="width: 350px; height: 150px") %]
241                   </td>
242                 </tr>
243               </table>
244             </td>
245
246             <td>
247               <table>
248                 <tr>
249                   <th align="right">[% 'Payment Terms' | $T8 %]</th>
250                   <td>[% L.select_tag('order.payment_id',
251                                       SELF.all_payment_terms,
252                                       default = SELF.order.payment_id,
253                                       with_empty = 1,
254                                       title_key = 'description',
255                                       style = 'width: 250px') %]</td>
256                 </tr>
257                 <tr>
258                   <th align="right">[% 'Delivery Terms' | $T8 %]</th>
259                   <td>[% L.select_tag('order.delivery_term_id',
260                                       SELF.all_delivery_terms,
261                                       default = SELF.order.delivery_term_id,
262                                       with_empty = 1,
263                                       title_key = 'description',
264                                       style = 'width: 250px') %]</td>
265                 </tr>
266               </table>
267             </td>
268
269           </tr>
270         </table>
271       </td>
272     </tr>
273
274   </table>
275
276   [% L.hidden_tag('order.taxzone_id', SELF.order.taxzone_id) %]
277
278 </div>
279
280 [% L.sortable_element('#row_table_id') %]