Auftrags-Controller: Einheiten per Select ändern können und sellprice anpassen.
[kivitendo-erp.git] / templates / webpages / order / tabs / _row.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5
6 <tbody class="row_entry">
7
8   <tr class="listrow0">
9     <td style='display:none'>
10       [% L.hidden_tag("orderitem_ids[+]", ID) %]
11       [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %]
12       [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %]
13     </td>
14     <td align="center">
15       <img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"  class="dragdrop">
16     </td>
17     <td align="center">
18       [%- L.button_tag("delete_order_item_row(this)",
19                        LxERP.t8("X"),
20                        confirm=LxERP.t8("Are you sure?")) %]
21     </td>
22     <td>
23       [% HTML.escape(ITEM.part.partnumber) %]
24     </td>
25     <td>
26       [% L.input_tag("order.orderitems[].description",
27                      ITEM.description,
28                      style='width: 300px') %]
29     </td>
30     <td>
31       [%- L.input_tag("order.orderitems[].qty_as_number",
32                       ITEM.qty_as_number,
33                       size = 5,
34                       style='text-align:right',
35                       class="recalc reformat_number") %]
36     </td>
37     <td>
38       [%- L.input_tag("order.orderitems[].price_factor",
39                       ITEM.price_factor,
40                       size = 5,
41                       style='text-align:right',
42                       class="recalc") %]
43     </td>
44     <td nowrap>
45       [%- L.select_tag("order.orderitems[].unit",
46                       ITEM.part.available_units,
47                       default = ITEM.unit,
48                       title_key = 'name',
49                       value_key = 'name',
50                       class = 'unitselect') %]
51     </td>
52     <td>
53       [%- L.button_tag("price_chooser_item_row(this)",
54                        ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
55                        name = "price_chooser_button") %]
56     </td>
57     <td>
58       [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
59       [%- SET EDIT_PRICE = (AUTH.assert('edit_prices', 1) && ITEM.active_price_source.source == '') %]
60       <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %]>
61         [%- L.input_tag("order.orderitems[].sellprice_as_number",
62                         ITEM.sellprice_as_number,
63                         size = 10,
64                         style='text-align:right',
65                         disabled=(EDIT_PRICE? '' : 1),
66                         class="recalc reformat_number") %]
67       </div>
68       <div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
69         [%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", style='text-align:right') %]
70         [%- L.hidden_tag("order.orderitems[].sellprice_as_number",
71                          ITEM.sellprice_as_number,
72                          disabled=(EDIT_PRICE? 1 : '')) %]
73       </div>
74     </td>
75     <td>
76       [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
77       [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
78       <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %]>
79         [%- L.input_tag("order.orderitems[].discount_as_percent",
80                         ITEM.discount_as_percent,
81                         size = 5,
82                         style='text-align:right',
83                         disabled=(EDIT_DISCOUNT? '' : 1),
84                         class="recalc reformat_number") %]
85       </div>
86       <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
87         [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", style='text-align:right') %]
88         [%- L.hidden_tag("order.orderitems[].discount_as_percent",
89                          ITEM.discount_as_percent,
90                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
91       </div>
92     </td>
93     <td align="right">
94       [%- L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal") %]
95     </td>
96
97   </tr>
98
99   <tr class="listrow1" style="display:none">
100     <td colspan="100%">
101       <table>
102         <tr class="listrow1">
103           [%- SET n = 0 %]
104           [%- FOREACH var = ITEM.cvars_by_config %]
105             [%- NEXT UNLESS (var.config.processed_flags.editable && ITEM.part.cvar_by_name(var.config.name).is_valid) %]
106             [%- SET n = n + 1 %]
107             <th>
108               [% var.config.description %]
109             </th>
110             <td>
111               [% L.hidden_tag('order.orderitems[].custom_variables[+].config_id', var.config.id) %]
112               [% L.hidden_tag('order.orderitems[].custom_variables[].id', var.id) %]
113               [% L.hidden_tag('order.orderitems[].custom_variables[].sub_module', var.sub_module) %]
114               [% INCLUDE 'common/render_cvar_input.html' var_name='order.orderitems[].custom_variables[].unparsed_value' %]
115             </td>
116             [%- IF (n % (MYCONFIG.form_cvars_nr_cols || 3)) == 0 %]
117               </tr><tr class="listrow1">
118             [%- END %]
119           [%- END %]
120         </tr>
121       </table>
122     </td>
123   </tr>
124
125 </tbody>