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