Vereinfachte Abkürzungsmethode "typeclass_abbreviation" im Part Presenter
[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">[% P.typeclass_abbreviation(ITEM.part) %]</div>
39     </td>
40     <td>
41       [% L.input_tag("order.orderitems[].description",
42                      ITEM.description,
43                      style='width: 300px') %]
44       [%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %]
45     </td>
46     <td>
47       [%- L.input_tag("order.orderitems[].qty_as_number",
48                       ITEM.qty_as_number,
49                       size = 5,
50                       class="recalc reformat_number numeric") %]
51     </td>
52     <td>
53       [%- L.select_tag("order.orderitems[].price_factor_id",
54                        ALL_PRICE_FACTORS,
55                        default = ITEM.price_factor_id,
56                        title_key = 'description',
57                        with_empty = 1,
58                        class="recalc") %]
59     </td>
60     <td nowrap>
61       [%- L.select_tag("order.orderitems[].unit",
62                       ITEM.part.available_units,
63                       default = ITEM.unit,
64                       title_key = 'name',
65                       value_key = 'name',
66                       class = 'unitselect') %]
67     </td>
68     <td>
69       [%- L.button_tag("kivi.Order.price_chooser_item_row(this)",
70                        ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
71                        name = "price_chooser_button") %]
72     </td>
73     <td>
74       [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
75       [%- SET EDIT_PRICE = (AUTH.assert('edit_prices', 1) && ITEM.active_price_source.source == '') %]
76       <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %] class="numeric">
77         [%- L.input_tag("order.orderitems[].sellprice_as_number",
78                         ITEM.sellprice_as_number,
79                         size = 10,
80                         disabled=(EDIT_PRICE? '' : 1),
81                         class="recalc reformat_number numeric") %]
82       </div>
83       <div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
84         [%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", class="numeric") %]
85         [%- L.hidden_tag("order.orderitems[].sellprice_as_number",
86                          ITEM.sellprice_as_number,
87                          disabled=(EDIT_PRICE? 1 : '')) %]
88       </div>
89     </td>
90     <td>
91       [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
92       [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
93       <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %] class="numeric">
94         [%- L.input_tag("order.orderitems[].discount_as_percent",
95                         ITEM.discount_as_percent,
96                         size = 5,
97                         disabled=(EDIT_DISCOUNT? '' : 1),
98                         class="recalc reformat_number numeric") %]
99       </div>
100       <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
101         [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", class="numeric") %]
102         [%- L.hidden_tag("order.orderitems[].discount_as_percent",
103                          ITEM.discount_as_percent,
104                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
105       </div>
106     </td>
107     <td align="right">
108       [%- L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal") %]
109     </td>
110
111   </tr>
112
113   <tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]>
114     <td colspan="100%">
115       [%- IF MYCONFIG.show_form_details %]
116         <div name="second_row" data-loaded="1">
117           [%- PROCESS order/tabs/_second_row.html ITEM=ITEM %]
118         </div>
119       [%- ELSE %]
120         <div name="second_row">
121           [%- LxERP.t8("Loading...") %]
122         </div>
123       [%- END %]
124     </td>
125   </tr>
126
127 </tbody>