Auftrags-Controller: 2. Zeilen beim 1. Klick einklappen, wenn Detailsanzeige an
[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 listrow"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]>
7   <tr>
8     <td align="center">
9       [%- IF MYCONFIG.show_form_details %]
10         [% L.img_tag(src="image/collapse3.gif",
11                      alt=LxERP.t8('Hide details'), title=LxERP.t8('Hide details'), class="expand") %]
12       [%- ELSE %]
13         [% L.img_tag(src="image/expand3.gif",
14                      alt=LxERP.t8('Show details'), title=LxERP.t8('Show details'), class="expand") %]
15       [%- END %]
16       [% L.hidden_tag("orderitem_ids[+]", ID) %]
17       [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %]
18       [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %]
19     </td>
20     <td>
21       <div name="position" class="numeric">
22         [% HTML.escape(ITEM.position) %]
23       </div>
24     </td>
25     <td align="center">
26       <img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop">
27     </td>
28     <td align="center">
29       [%- L.button_tag("kivi.Order.delete_order_item_row(this)",
30                        LxERP.t8("X"),
31                        confirm=LxERP.t8("Are you sure?")) %]
32     </td>
33     <td>
34       <div name="partnumber">[% HTML.escape(ITEM.part.partnumber) %]</div>
35     </td>
36     <td>
37       [% L.input_tag("order.orderitems[].description",
38                      ITEM.description,
39                      style='width: 300px') %]
40       [%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %]
41     </td>
42     <td>
43       [%- L.input_tag("order.orderitems[].qty_as_number",
44                       ITEM.qty_as_number,
45                       size = 5,
46                       class="recalc reformat_number numeric") %]
47     </td>
48     <td>
49       [%- L.select_tag("order.orderitems[].price_factor_id",
50                        ALL_PRICE_FACTORS,
51                        default = ITEM.price_factor_id,
52                        title_key = 'description',
53                        with_empty = 1,
54                        class="recalc") %]
55     </td>
56     <td nowrap>
57       [%- L.select_tag("order.orderitems[].unit",
58                       ITEM.part.available_units,
59                       default = ITEM.unit,
60                       title_key = 'name',
61                       value_key = 'name',
62                       class = 'unitselect') %]
63     </td>
64     <td>
65       [%- L.button_tag("kivi.Order.price_chooser_item_row(this)",
66                        ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
67                        name = "price_chooser_button") %]
68     </td>
69     <td>
70       [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
71       [%- SET EDIT_PRICE = (AUTH.assert('edit_prices', 1) && ITEM.active_price_source.source == '') %]
72       <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %] class="numeric">
73         [%- L.input_tag("order.orderitems[].sellprice_as_number",
74                         ITEM.sellprice_as_number,
75                         size = 10,
76                         disabled=(EDIT_PRICE? '' : 1),
77                         class="recalc reformat_number numeric") %]
78       </div>
79       <div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
80         [%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", class="numeric") %]
81         [%- L.hidden_tag("order.orderitems[].sellprice_as_number",
82                          ITEM.sellprice_as_number,
83                          disabled=(EDIT_PRICE? 1 : '')) %]
84       </div>
85     </td>
86     <td>
87       [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
88       [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
89       <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %] class="numeric">
90         [%- L.input_tag("order.orderitems[].discount_as_percent",
91                         ITEM.discount_as_percent,
92                         size = 5,
93                         disabled=(EDIT_DISCOUNT? '' : 1),
94                         class="recalc reformat_number numeric") %]
95       </div>
96       <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
97         [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", class="numeric") %]
98         [%- L.hidden_tag("order.orderitems[].discount_as_percent",
99                          ITEM.discount_as_percent,
100                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
101       </div>
102     </td>
103     <td align="right">
104       [%- L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal") %]
105     </td>
106
107   </tr>
108
109   <tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]>
110     <td colspan="100%">
111       [%- IF MYCONFIG.show_form_details %]
112         <div name="second_row" data-loaded="1">
113           [%- PROCESS order/tabs/_second_row.html ITEM=ITEM %]
114         </div>
115       [%- ELSE %]
116         <div name="second_row">
117           [%- LxERP.t8("Loading...") %]
118         </div>
119       [%- END %]
120     </td>
121   </tr>
122
123 </tbody>