0e6e1294c7efd406a73597e32f97ebee3dc663b0
[kivitendo-erp.git] / templates / webpages / delivery_order / tabs / _row.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6
7 <tbody class="row_entry listrow" data-position="[%- HTML.escape(ITEM.position) -%]"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]>
8   <tr>
9     <td align="center">
10       [%- IF MYCONFIG.show_form_details %]
11         [% L.img_tag(src="image/collapse.svg",
12                      alt=LxERP.t8('Hide details'), title=LxERP.t8('Hide details'), class="expand") %]
13       [%- ELSE %]
14         [% L.img_tag(src="image/expand.svg",
15                      alt=LxERP.t8('Show details'), title=LxERP.t8('Show details'), class="expand") %]
16       [%- END %]
17       [% L.hidden_tag("orderitem_ids[+]", ID) %]
18       [% L.hidden_tag("converted_from_orderitems_ids[+]", ITEM.converted_from_orderitems_id) %]
19       [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %]
20       [% L.hidden_tag("order.orderitems[].stock_info", ITEM.stock_info, class="data-stock-info") %]
21       [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %]
22     </td>
23     <td>
24       <div name="position" class="numeric">
25         [% HTML.escape(ITEM.position) %]
26       </div>
27     </td>
28     <td align="center">
29       <img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop">
30     </td>
31     <td align="center">
32       [%- L.button_tag("kivi.DeliveryOrder.delete_order_item_row(this)",
33                        LxERP.t8("X"),
34                        confirm=LxERP.t8("Are you sure?")) %]
35     </td>
36     [%- IF SELF.show_update_button -%]
37     <td align="center">
38       [%- L.img_tag(src="image/rotate_cw.svg",
39                     alt=LxERP.t8('Update from master data'),
40                     title= LxERP.t8('Update from master data'),
41                     onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.DeliveryOrder.update_row_from_master_data(this);",
42                     id='update_from_master') %]
43     </td>
44     [%- END -%]
45     <td>
46       <div name="partnumber">
47         [%- P.link_tag(SELF.url_for(controller='Part', action='edit', 'part.id'=ITEM.part.id), ITEM.part.partnumber, target="_blank", title=LxERP.t8('Open in new window')) -%]
48       </div>
49     </td>
50     [%- IF SELF.search_cvpartnumber -%]
51     <td>
52       <div name="cvpartnumber">[% HTML.escape(ITEM.cvpartnumber) %]</div>
53     </td>
54     [%- END -%]
55     <td>
56       <div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div>
57     </td>
58     <td>
59       [% L.areainput_tag("order.orderitems[].description",
60                      ITEM.description,
61                      size='40',
62                      style='width: 300px') %]
63       [%- L.hidden_tag("order.orderitems[].longdescription", ITEM.longdescription) %]
64       [%- L.button_tag("kivi.DeliveryOrder.show_longdescription_dialog(this)", LxERP.t8("L")) %]
65     </td>
66     [%- IF (SELF.type == "sales_order" || SELF.type == "purchase_order") -%]
67     <td nowrap>
68       [%- L.div_tag(LxERP.format_amount(ITEM.shipped_qty, 2, 0) _ ' ' _ ITEM.unit, name="shipped_qty", class="numeric") %]
69     </td>
70     [%- END -%]
71     <td nowrap>
72       [%- L.input_tag("order.orderitems[].qty_as_number",
73                       ITEM.qty_as_number,
74                       size = 5,
75                       class="reformat_number numeric") %]
76       [%- IF ITEM.part.formel -%]
77         [%- L.button_tag("kivi.DeliveryOrder.show_calculate_qty_dialog(this)", LxERP.t8("*/")) %]
78         [%- L.hidden_tag("formula[+]", ITEM.part.formel) -%]
79       [%- END -%]
80     </td>
81     <td nowrap>
82       [%- L.select_tag("order.orderitems[].unit",
83                       ITEM.part.available_units,
84                       default = ITEM.unit,
85                       title_key = 'name',
86                       value_key = 'name',
87                       class = 'unitselect') %]
88     </td>
89
90     <td>
91       <span id="stock_[% ID %]" class="data-stock-qty">[% SELF.calculate_stock_in_out(ITEM) %]</span>
92       [% P.button_tag("kivi.DeliveryOrder.open_stock_in_out_dialog(this, '" _ in_out _"')", "?") %]
93     </td>
94   </tr>
95
96   <tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]>
97     <td colspan="100%">
98       [%- IF MYCONFIG.show_form_details || ITEM.render_second_row %]
99         <div name="second_row" data-loaded="1">
100           [%- PROCESS delivery_order/tabs/_second_row.html ITEM=ITEM TYPE=SELF.type %]
101         </div>
102       [%- ELSE %]
103         <div name="second_row" id="second_row_[% ID %]">
104           [%- LxERP.t8("Loading...") %]
105         </div>
106       [%- END %]
107     </td>
108   </tr>
109
110 </tbody>