]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/reclamation/tabs/basic_data/_row.html
Merge branch 'master' of http://wagnertech.de/git/mfinanz
[mfinanz.git] / templates / webpages / reclamation / tabs / basic_data / _row.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6 [% # L.dump( ITEM ) %]
7
8 <tbody class="row_entry listrow" data-position="[%- HTML.escape(ITEM.position) -%]"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]>
9   <tr>
10   [% L.hidden_tag("reclamation_item_ids[+]", ID) %]
11   [% L.hidden_tag("converted_from_record_item_type_ref[+]", ITEM.converted_from_record_item_type_ref) %]
12   [% L.hidden_tag("converted_from_record_item_id[+]",       ITEM.converted_from_record_item_id) %]
13   [% L.hidden_tag("reclamation.reclamation_items[+].id", ITEM.id, id='item_' _ ID) %]
14   [% L.hidden_tag("reclamation.reclamation_items[].parts_id", ITEM.parts_id) %]
15     <td align="center">
16       [%- IF MYCONFIG.show_form_details %]
17         [% L.img_tag(src="image/collapse.svg",
18                      alt=LxERP.t8('Hide details'), title=LxERP.t8('Hide details'), class="expand") %]
19       [%- ELSE %]
20         [% L.img_tag(src="image/expand.svg",
21                      alt=LxERP.t8('Show details'), title=LxERP.t8('Show details'), class="expand") %]
22       [%- END %]
23     </td>
24     <td>
25       [% L.checkbox_tag('multi_id_' _ ITEM.position, value=ITEM.id, checked=0) %]
26     </td>
27     <td>
28       <div name="position" class="numeric">
29         [% HTML.escape(ITEM.position) %]
30       </div>
31     </td>
32     <td align="center">
33       <img src="image/updown.png" alt="[%- LxERP.t8('reclamation item') %]" class="dragdrop">
34     </td>
35     <td align="center">
36       [%- L.button_tag("kivi.Reclamation.delete_reclamation_item_row(this)",
37                        LxERP.t8("X"),
38                        confirm=LxERP.t8("Are you sure?")) %]
39     </td>
40     [%- IF SELF.show_update_button -%]
41     <td align="center">
42       [%- L.img_tag(src="image/rotate_cw.svg",
43                     alt=LxERP.t8('Update from master data'),
44                     title= LxERP.t8('Update from master data'),
45                     onclick="if (!confirm('" _ LxERP.t8("Are you sure to update this position from master data?") _ "')) return false; kivi.Reclamation.update_row_from_master_data(this);",
46                     id='update_from_master') %]
47     </td>
48     [%- END -%]
49     <td>
50       <div name="partnumber">
51         [%- 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')) -%]
52       </div>
53     </td>
54     [%- IF SELF.search_cvpartnumber -%]
55     <td>
56       <div name="cvpartnumber">[% HTML.escape(ITEM.cvpartnumber) %]</div>
57     </td>
58     [%- END -%]
59     <td>
60       <div name="partclassification">[% ITEM.part.presenter.typeclass_abbreviation %]</div>
61     </td>
62     <td>
63       [% L.areainput_tag("reclamation.reclamation_items[].description",
64                      ITEM.description,
65                      size='40',
66                      style='width: 300px') %]
67       [%- L.hidden_tag("reclamation.reclamation_items[].longdescription", ITEM.longdescription) %]
68       [%- L.button_tag("kivi.Reclamation.show_longdescription_dialog(this)", LxERP.t8("L")) %]
69     </td>
70     <td>[% L.select_tag("reclamation.reclamation_items[].reason_id",
71                         SELF.reclamation.valid_reclamation_reasons,
72                         default=ITEM.reason_id,
73                         title_key = 'name',
74                         value_key = 'id',
75                         with_empty=1,) %]
76     </td>
77     <td>
78       [% L.areainput_tag("reclamation.reclamation_items[].reason_description_ext",
79                      ITEM.reason_description_ext,
80                      size='40',
81                      style='width: 150px') %]
82     </td>
83     <td>
84       [% L.areainput_tag("reclamation.reclamation_items[].reason_description_int",
85                      ITEM.reason_description_int,
86                      size='40',
87                      style='width: 150px') %]
88     </td>
89     <td nowrap>
90       [%- L.input_tag("reclamation.reclamation_items[].qty_as_number",
91                       ITEM.qty_as_number,
92                       size = 5,
93                       class="recalc reformat_number numeric") %]
94       [%- IF ITEM.part.formel -%]
95         [%- L.button_tag("kivi.Reclamation.show_calculate_qty_dialog(this)", LxERP.t8("*/")) %]
96         [%- L.hidden_tag("formula[+]", ITEM.part.formel) -%]
97       [%- END -%]
98     </td>
99     <td>
100       [%- L.select_tag("reclamation.reclamation_items[].price_factor_id",
101                        SELF.all_price_factors,
102                        default = ITEM.price_factor_id,
103                        title_key = 'description',
104                        with_empty = 1,
105                        class="recalc") %]
106     </td>
107     <td nowrap>
108       [%- L.select_tag("reclamation.reclamation_items[].unit",
109                       ITEM.part.available_units,
110                       default = ITEM.unit,
111                       title_key = 'name',
112                       value_key = 'name',
113                       class = 'unitselect') %]
114     </td>
115     <td>
116       [%- SET EDIT_PRICE_SOURCE = !(ITEM.is_linked_to_record) %]
117       <div name="editable_price_source" [%- IF !EDIT_PRICE_SOURCE %]style="display:none"[%- END %]>
118         [%- L.button_tag("kivi.Reclamation.price_chooser_item_row(this)",
119                          ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description,
120                          name = "price_chooser_button") %]
121       </div>
122       <div name="not_editable_price_source" [%- IF EDIT_PRICE_SOURCE %]style="display:none"[%- END %]>
123         [%- L.div_tag(ITEM.active_price_source.description _ ' | ' _ ITEM.active_discount_source.source_description, style="white-space:nowrap;") %]
124       </div>
125     </td>
126     [% SET RIGHT_TO_EDIT_PRICES = 0 %]
127     [% IF (SELF.type == "sales_reclamation") %]
128       [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('sales_edit_prices', 1) %]
129     [% END %]
130     [% IF (SELF.type == "purchase_reclamation") %]
131       [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('purchase_edit_prices', 1) %]
132     [% END %]
133     <td>
134       [%- L.hidden_tag("reclamation.reclamation_items[].active_price_source", ITEM.active_price_source.source) %]
135       [%- SET EDIT_PRICE = (RIGHT_TO_EDIT_PRICES && ITEM.active_price_source.source == '' && !ITEM.is_linked_to_record) %]
136       <div name="editable_price" [%- IF !EDIT_PRICE %]style="display:none"[%- END %] class="numeric">
137         [%- L.input_tag("reclamation.reclamation_items[].sellprice_as_number",
138                         ITEM.sellprice_as_number,
139                         size = 10,
140                         disabled=(EDIT_PRICE? '' : 1),
141                         class="recalc reformat_number numeric") %]
142       </div>
143       <div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
144         [%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", class="numeric") %]
145         [%- L.hidden_tag("reclamation.reclamation_items[].sellprice_as_number",
146                          ITEM.sellprice_as_number,
147                          disabled=(EDIT_PRICE? 1 : '')) %]
148       </div>
149     </td>
150     <td>
151       [%- L.hidden_tag("reclamation.reclamation_items[].active_discount_source", ITEM.active_discount_source.source) %]
152       [%- SET EDIT_DISCOUNT = (RIGHT_TO_EDIT_PRICES && ITEM.active_discount_source.source == '' && !ITEM.is_linked_to_record) %]
153       <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %] class="numeric">
154         [%- L.input_tag("reclamation.reclamation_items[].discount_as_percent",
155                         ITEM.discount_as_percent,
156                         size = 5,
157                         disabled=(EDIT_DISCOUNT? '' : 1),
158                         class="recalc reformat_number numeric") %]
159       </div>
160       <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
161         [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", class="numeric") %]
162         [%- L.hidden_tag("reclamation.reclamation_items[].discount_as_percent",
163                          ITEM.discount_as_percent,
164                          disabled=(EDIT_DISCOUNT? 1 : '')) %]
165       </div>
166     </td>
167     <td align="right">
168       [%- L.div_tag(LxERP.format_amount(ITEM.linetotal, 2, 0), name="linetotal") %]
169     </td>
170
171   </tr>
172
173   <tr [%- IF !MYCONFIG.show_form_details -%]style="display:none"[%- END -%]>
174     <td colspan="100%">
175       [%- IF MYCONFIG.show_form_details || ITEM.render_second_row %]
176         <div name="second_row" data-loaded="1">
177           [%- PROCESS reclamation/tabs/basic_data/_second_row.html ITEM=ITEM TYPE=SELF.type %]
178         </div>
179       [%- ELSE %]
180         <div name="second_row" id="second_row_[% ID %]">
181           [%- LxERP.t8("Loading...") %]
182         </div>
183       [%- END %]
184     </td>
185   </tr>
186
187 </tbody>