]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/order/tabs/_row.html
date error in mapping
[mfinanz.git] / templates / design40_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" data-position="[%- HTML.escape(ITEM.position) -%]"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]>
8   <tr>
9     <td>
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 row-icon") %]
13       [% ELSE %]
14         [% L.img_tag(src="image/expand.svg",
15                      alt=LxERP.t8('Show details'), title=LxERP.t8('Show details'), class="expand row-icon") %]
16       [% END %]
17       [% L.hidden_tag("orderitem_ids[+]", ID) %]
18       [% L.hidden_tag("converted_from_record_item_type_ref[+]", ITEM.converted_from_record_item_type_ref) %]
19       [% L.hidden_tag("converted_from_record_item_id[+]",       ITEM.converted_from_record_item_id) %]
20       [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %]
21       [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %]
22       [% L.hidden_tag("basket_item_ids[+]", ITEM.basket_item_id) %]
23     </td>
24     <td class="center"><div name="position">[% HTML.escape(ITEM.position) %]</div></td>
25     <td><img src="image/updown.png" alt="[% LxERP.t8('reorder item') %]" class="dragdrop"></td>
26     <td>
27       [% L.button_tag("kivi.Order.delete_order_item_row(this)",
28                       LxERP.t8("X"),
29                       confirm=LxERP.t8("Are you sure?")) %]
30     </td>
31     [%- IF SELF.show_update_button -%]
32     <td>
33       [%- L.img_tag(src="image/rotate_cw.svg",
34                     alt=LxERP.t8('Update from master data'),
35                     title= LxERP.t8('Update from master data'),
36                     onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.Order.update_row_from_master_data(this);",
37                     class='row-icon',
38                     id='update_from_master') %]
39     </td>
40     [%- END -%]
41     <td>
42       <div name="partnumber">
43         [%- P.link_tag(SELF.url_for(controller='Part', action='edit', 'part.id'=ITEM.part.id), ITEM.part.partnumber, target="_blank", title=LxERP.t8('Open in new window')) -%]
44       </div>
45     </td>
46     [%- IF SELF.search_cvpartnumber -%]
47     <td><div name="cvpartnumber">[% HTML.escape(ITEM.cvpartnumber) %]</div></td>
48     [%- END -%]
49     <td><div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div></td>
50     <td>
51       [% L.areainput_tag("order.orderitems[].description",
52                      ITEM.description,
53                      size='40',
54                      class='wi-lightwide') %]
55       [% L.hidden_tag("order.orderitems[].longdescription", ITEM.longdescription) %]
56       [% L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L"), class="wi-tiny neutral") %]
57     </td>
58     [% IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation") %]
59     <td>
60       [%- L.div_tag(LxERP.format_amount(ITEM.shipped_qty, 2, 0) _ ' ' _ ITEM.unit, name="shipped_qty", class="numeric") %]
61     </td>
62     [%- END -%]
63     <td>
64       [% L.input_tag("order.orderitems[].qty_as_number",
65                       ITEM.qty_as_number,
66                       size = 5,
67                       class="recalc reformat_number numeric wi-verysmall") %]
68       [% IF ITEM.part.formel %]
69         [% L.button_tag("kivi.Order.show_calculate_qty_dialog(this)", LxERP.t8("*/"), class="neutral") %]
70         [% L.hidden_tag("formula[+]", ITEM.part.formel) %]
71       [% END %]
72     </td>
73     <td>
74       [% L.select_tag("order.orderitems[].price_factor_id",
75                        SELF.all_price_factors,
76                        default = ITEM.price_factor_id,
77                        title_key = 'description',
78                        with_empty = 1,
79                        class="recalc wi-mediumsmall") %]
80     </td>
81     <td>
82       [% L.select_tag("order.orderitems[].unit",
83                       ITEM.part.available_units,
84                       default = ITEM.unit,
85                       title_key = 'name',
86                       value_key = 'name',
87                       class = 'unitselect wi-mediumsmall') %]
88     </td>
89     <td>
90       [% L.button_tag("kivi.Order.price_chooser_item_row(this)",
91                        ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
92                        name = "price_chooser_button",
93                        class = "neutral") %]
94     </td>
95     [% SET RIGHT_TO_EDIT_PRICES = 0 %]
96     [% IF (SELF.type == "sales_order_intake" || SELF.type == "sales_order" || SELF.type == "sales_quotation") %]
97       [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('sales_edit_prices', 1) %]
98     [% END %]
99     [% IF (SELF.type == "purchase_order" || SELF.type == "purchase_order_confirmation" || SELF.type == "request_quotation" || SELF.type == "purchase_quotation_intake") %]
100       [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('purchase_edit_prices', 1) %]
101     [% END %]
102     <td>
103       [% L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %]
104       [% SET EDIT_PRICE = (RIGHT_TO_EDIT_PRICES && ITEM.active_price_source.source == '') %]
105       <div name="editable_price" [% IF !EDIT_PRICE %]style="display:none"[% END %] class="numeric">
106         [% L.input_tag("order.orderitems[].sellprice_as_number",
107                         ITEM.sellprice_as_number,
108                         size = 10,
109                         disabled=(EDIT_PRICE? '' : 1),
110                         class="recalc reformat_number numeric wi-verysmall") %]
111       </div>
112       <div name="not_editable_price" [% IF EDIT_PRICE %]style="display:none"[% END %]>
113         [% L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", class="numeric plain-data") %]  <!-- PENDENT: plain-data in DIV noch dem CSS hinzufuegen -->
114         [% L.hidden_tag("order.orderitems[].sellprice_as_number",
115                          ITEM.sellprice_as_number,
116                          disabled=(EDIT_PRICE? 1 : '')) %]
117       </div>
118     </td>
119     <td>
120       [% L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
121       [% SET EDIT_DISCOUNT = (RIGHT_TO_EDIT_PRICES && ITEM.active_discount_source.source == '') %]
122       <div name="editable_discount" [% IF !EDIT_DISCOUNT %]style="display:none"[% END %] class="numeric">
123         [% L.input_tag("order.orderitems[].discount_as_percent",
124                         ITEM.discount_as_percent,
125                         size = 5,
126                         disabled=(EDIT_DISCOUNT? '' : 1),
127                         class="recalc reformat_number numeric") %]
128       </div>
129       <div name="not_editable_discount" [% IF EDIT_DISCOUNT %]style="display:none"[% END %]>
130         [% L.div_tag(ITEM.discount_as_percent, name="discount_text", class="numeric") %]
131         [% L.hidden_tag("order.orderitems[].discount_as_percent",
132                          ITEM.discount_as_percent,
133                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
134       </div>
135     </td>
136     <td>[% L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal", class="numeric") %]</td>
137   </tr>
138   <tr [% IF !MYCONFIG.show_form_details %]style="display:none"[% END %]>
139     <td colspan="100%">
140       [% IF MYCONFIG.show_form_details || ITEM.render_second_row %]
141         <div name="second_row" data-loaded="1">
142           [% PROCESS order/tabs/_second_row.html ITEM=ITEM TYPE=SELF.type %]
143         </div>
144       [% ELSE %]
145         <div name="second_row" id="second_row_[% ID %]">
146           [% LxERP.t8("Loading...") %]
147         </div>
148       [% END %]
149     </td>
150   </tr>
151 </tbody>