- [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source) %]
- [%- L.input_tag("order.orderitems[].discount_as_percent",
- ITEM.discount_as_percent,
- size = 5,
- style='text-align:right',
- class="recalc") %]
+ [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %]
+ [%- SET EDIT_DISCOUNT = (AUTH.assert('edit_prices', 1) && ITEM.active_discount_source.source == '') %]
+ <div name="editable_discount" [%- IF !EDIT_DISCOUNT %]style="display:none"[%- END %]>
+ [%- L.input_tag("order.orderitems[].discount_as_percent",
+ ITEM.discount_as_percent,
+ size = 5,
+ style='text-align:right',
+ disabled=(EDIT_DISCOUNT? '' : 1),
+ class="recalc reformat_number") %]
+ </div>
+ <div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
+ [%- L.div_tag(ITEM.discount_as_percent, name="discount_text", style='text-align:right') %]
+ [%- L.hidden_tag("order.orderitems[].discount_as_percent",
+ ITEM.discount_as_percent,
+ disabled=(EDIT_DISCOUNT? 1 : '')) %]
+ </div>