Auftrags-Controller: javascript-Code in eigene Datei auslagern
[kivitendo-erp.git] / templates / webpages / order / tabs / _price_sources_dialog.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE L %]
4 [%- USE LxERP %]
5 [% SET best_price = price_source.best_price %]
6 [% SET best_discount = price_source.best_discount %]
7 [% SET price_editable = AUTH.assert('edit_prices', 1) %]
8   <h2>[% 'Prices' | $T8 %]</h2>
9
10   <table>
11    <tr class='listheading'>
12     <th></th>
13     <th>[% 'Price Source' | $T8 %]</th>
14     <th>[% 'Price' | $T8 %]</th>
15     <th>[% 'Best Price' | $T8 %]</th>
16     <th>[% 'Details' | $T8 %]</th>
17    </tr>
18    <tr class='listrow'>
19 [%- IF price_source.record_item.active_price_source %]
20     <td>[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
21 [%- ELSE %]
22     <td><b>[% 'Selected' | $T8 %]</b></td>
23 [%- END %]
24     <td>[% 'None (PriceSource)' | $T8 %]</td>
25     <td>-</td>
26     <td></td>
27     <td></td>
28    </tr>
29    [%- FOREACH price IN price_source.available_prices %]
30     <tr class='listrow'>
31 [%- IF price_source.record_item.active_price_source != price.source %]
32      <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>
33 [%- ELSIF price_source.record_item.sellprice * 1 != price.price * 1 %]
34      <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>
35 [%- ELSE %]
36     <td><b>[% 'Selected' | $T8 %]</b></td>
37 [% END %]
38      <td>[% price.source_description | html %]</td>
39      <td>[% price.price_as_number %]</td>
40 [% IF price.source == best_price.source %]
41      <td align='center'>&#x2022;</td>
42 [% ELSE %]
43      <td></td>
44 [% END %]
45      <td>[% price.description | html %]</td>
46     </tr>
47    [%- END %]
48   </table>
49
50   <h2>[% 'Discounts' | $T8 %]</h2>
51
52   <table>
53    <tr class='listheading'>
54     <th></th>
55     <th>[% 'Price Source' | $T8 %]</th>
56     <th>[% 'Discount' | $T8 %]</th>
57     <th>[% 'Best Discount' | $T8 %]</th>
58     <th>[% 'Details' | $T8 %]</th>
59    </tr>
60    <tr class='listrow'>
61 [%- IF price_source.record_item.active_discount_source %]
62     <td>[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource Discount)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %]</td>
63 [%- ELSE %]
64     <td><b>[% 'Selected' | $T8 %]</b></td>
65 [%- END %]
66     <td>[% 'None (PriceSource Discount)' | $T8 %]</td>
67     <td>-</td>
68     <td></td>
69     <td></td>
70    </tr>
71    [%- FOREACH price IN price_source.available_discounts %]
72     <tr class='listrow'>
73 [%- IF price_source.record_item.active_discount_source != price.source %]
74      <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>
75 [%- ELSIF price_source.record_item.discount * 1 != price.discount * 1 %]
76      <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>
77 [%- ELSE %]
78     <td><b>[% 'Selected' | $T8 %]</b></td>
79 [% END %]
80      <td>[% price.source_description | html %]</td>
81      <td>[% price.discount_as_percent %] %</td>
82 [% IF price.source == best_discount.source %]
83      <td align='center'>&#x2022;</td>
84 [% ELSE %]
85      <td></td>
86 [% END %]
87      <td>[% price.description | html %]</td>
88     </tr>
89    [%- END %]
90   </table>