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