Auftrags-Controller: Positions-Update aus Artikel-Stamm
[kivitendo-erp.git] / templates / webpages / 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"[%- 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[].parts_id", ITEM.parts_id) %]
21     </td>
22     <td>
23       <div name="position" class="numeric">
24         [% HTML.escape(ITEM.position) %]
25       </div>
26     </td>
27     <td align="center">
28       <img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop">
29     </td>
30     <td align="center">
31       [%- L.button_tag("kivi.Order.delete_order_item_row(this)",
32                        LxERP.t8("X"),
33                        confirm=LxERP.t8("Are you sure?")) %]
34     </td>
35     <td align="center">
36       [%- L.img_tag(src="image/rotate_cw.svg",
37                     alt=LxERP.t8('Update from master data'),
38                     title= LxERP.t8('Update from master data'),
39                     onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.Order.update_row_from_master_data(this);",
40                     id='update_from_master') %]
41     </td>
42     <td>
43       <div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div>
44     </td>
45     [%- IF SEARCH_CVPARTNUMBER -%]
46     <td>
47       <div name="cvpartnumber">[% HTML.escape(ITEM.cvpartnumber) %]</div>
48     </td>
49     [%- END -%]
50     <td>
51       <div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div>
52     </td>
53     <td>
54       [% L.areainput_tag("order.orderitems[].description",
55                      ITEM.description,
56                      size='40',
57                      style='width: 300px') %]
58       [%- IF ITEM.render_longdescription -%]
59         [%- L.hidden_tag("order.orderitems[].longdescription", ITEM.longdescription) %]
60       [%- END -%]
61       [%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %]
62     </td>
63     [%- IF (TYPE == "sales_order" || TYPE == "purchase_order") -%]
64     <td nowrap>
65       [%- L.div_tag(LxERP.format_amount(ITEM.shipped_qty, 2, 0) _ ' ' _ ITEM.unit, name="shipped_qty", class="numeric") %]
66     </td>
67     [%- END -%]
68     <td nowrap>
69       [%- L.input_tag("order.orderitems[].qty_as_number",
70                       ITEM.qty_as_number,
71                       size = 5,
72                       class="recalc reformat_number numeric") %]
73       [%- IF ITEM.part.formel -%]
74         [%- L.button_tag("kivi.Order.show_calculate_qty_dialog(this)", LxERP.t8("*/")) %]
75         [%- L.hidden_tag("formula[+]", ITEM.part.formel) -%]
76       [%- END -%]
77     </td>
78     <td>
79       [%- L.select_tag("order.orderitems[].price_factor_id",
80                        ALL_PRICE_FACTORS,
81                        default = ITEM.price_factor_id,
82                        title_key = 'description',
83                        with_empty = 1,
84                        class="recalc") %]
85     </td>
86     <td nowrap>
87       [%- L.select_tag("order.orderitems[].unit",
88                       ITEM.part.available_units,
89                       default = ITEM.unit,
90                       title_key = 'name',
91                       value_key = 'name',
92                       class = 'unitselect') %]
93     </td>
94     <td>
95       [%- L.button_tag("kivi.Order.price_chooser_item_row(this)",
96                        ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
97                        name = "price_chooser_button") %]
98     </td>
99     <td>
100       [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
101       [%- SET EDIT_PRICE = (AUTH.assert('edit_prices', 1) && ITEM.active_price_source.source == '') %]
102       <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %] class="numeric">
103         [%- L.input_tag("order.orderitems[].sellprice_as_number",
104                         ITEM.sellprice_as_number,
105                         size = 10,
106                         disabled=(EDIT_PRICE? '' : 1),
107                         class="recalc reformat_number numeric") %]
108       </div>
109       <div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
110         [%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", class="numeric") %]
111         [%- L.hidden_tag("order.orderitems[].sellprice_as_number",
112                          ITEM.sellprice_as_number,
113                          disabled=(EDIT_PRICE? 1 : '')) %]
114       </div>
115     </td>
116     <td>
117       [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
118       [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
119       <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %] class="numeric">
120         [%- L.input_tag("order.orderitems[].discount_as_percent",
121                         ITEM.discount_as_percent,
122                         size = 5,
123                         disabled=(EDIT_DISCOUNT? '' : 1),
124                         class="recalc reformat_number numeric") %]
125       </div>
126       <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
127         [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", class="numeric") %]
128         [%- L.hidden_tag("order.orderitems[].discount_as_percent",
129                          ITEM.discount_as_percent,
130                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
131       </div>
132     </td>
133     <td align="right">
134       [%- L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal") %]
135     </td>
136
137   </tr>
138
139   <tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]>
140     <td colspan="100%">
141       [%- IF MYCONFIG.show_form_details || ITEM.render_second_row %]
142         <div name="second_row" data-loaded="1">
143           [%- PROCESS order/tabs/_second_row.html ITEM=ITEM TYPE=TYPE %]
144         </div>
145       [%- ELSE %]
146         <div name="second_row" id="second_row_[% ID %]">
147           [%- LxERP.t8("Loading...") %]
148         </div>
149       [%- END %]
150     </td>
151   </tr>
152
153 </tbody>