5 [% SET best_price = price_source.best_price %]
6 [% SET best_discount = price_source.best_discount %]
7 [% SET price_editable = 0 %]
8 [% IF (FORM.type == "sales_order" || FORM.type == "sales_quotation") %]
9 [% SET price_editable = AUTH.assert('sales_edit_prices', 1) %]
11 [% IF (FORM.type == "purchase_order" || FORM.type == "request_quotation") %]
12 [% SET price_editable = AUTH.assert('purchase_edit_prices', 1) %]
14 <h2>[% 'Prices' | $T8 %]</h2>
17 <tr class='listheading'>
19 <th>[% 'Price Source' | $T8 %]</th>
20 <th>[% 'Price' | $T8 %]</th>
21 <th>[% 'Best Price' | $T8 %]</th>
22 <th>[% 'Details' | $T8 %]</th>
25 [%- IF price_source.record_item.active_price_source %]
26 <td>[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
28 <td><b>[% 'Selected' | $T8 %]</b></td>
30 <td>[% 'None (PriceSource)' | $T8 %]</td>
35 [%- FOREACH price IN price_source.available_prices %]
37 [%- IF price_source.record_item.active_price_source != price.source %]
38 <td>[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ LxERP.format_amount(price.price, -2) _ '\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
39 [%- ELSIF price_source.record_item.sellprice * 1 != price.price * 1 %]
40 <td>[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ LxERP.format_amount(price.price, -2) _ '\', ' _ price_editable _ ')', LxERP.t8('Update Price')) %]</td>
42 <td><b>[% 'Selected' | $T8 %]</b></td>
44 <td>[% price.source_description | html %]</td>
45 <td>[% price.price_as_number %]</td>
46 [% IF price.source == best_price.source %]
47 <td align='center'>•</td>
51 <td>[% price.description | html %]</td>
56 <h2>[% 'Discounts' | $T8 %]</h2>
59 <tr class='listheading'>
61 <th>[% 'Price Source' | $T8 %]</th>
62 <th>[% 'Discount' | $T8 %]</th>
63 <th>[% 'Best Discount' | $T8 %]</th>
64 <th>[% 'Details' | $T8 %]</th>
67 [%- IF price_source.record_item.active_discount_source %]
68 <td>[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource Discount)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
70 <td><b>[% 'Selected' | $T8 %]</b></td>
72 <td>[% 'None (PriceSource Discount)' | $T8 %]</td>
77 [%- FOREACH price IN price_source.available_discounts %]
79 [%- IF price_source.record_item.active_discount_source != price.source %]
80 <td>[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
81 [%- ELSIF price_source.record_item.discount * 1 != price.discount * 1 %]
82 <td>[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\', ' _ price_editable _ ')', LxERP.t8('Update Discount')) %]</td>
84 <td><b>[% 'Selected' | $T8 %]</b></td>
86 <td>[% price.source_description | html %]</td>
87 <td>[% price.discount_as_percent %] %</td>
88 [% IF price.source == best_discount.source %]
89 <td align='center'>•</td>
93 <td>[% price.description | html %]</td>