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