51f6066d31e58058354cbbc0cd4a6bf5348528e9
[kivitendo-erp.git] / templates / webpages / price_rule / form.html
1 [%- USE T8 %]
2 [%- USE L %][%- USE P %]
3 [%- USE HTML %][%- USE LxERP %]
4
5 <h1>[% title %]</h1>
6
7 [%- INCLUDE 'common/flash.html' %]
8
9  <form method="post" action="controller.pl">
10   [% L.hidden_tag("price_rule.id",   SELF.price_rule.id) %]
11   [% L.hidden_tag("price_rule.type", SELF.price_rule.type) %]
12
13   <table>
14    <tr>
15     <th align="right">[% 'Name' | $T8 %]</th>
16     <td>[% L.input_tag("price_rule.name", SELF.price_rule.name, size=60, class='initial_focus') %]</td>
17    </tr>
18    <tr>
19     <th align="right">[% 'Priority' | $T8 %]</th>
20     <td>[% L.select_tag('price_rule.priority', [ [3, LxERP.t8('Normal') ], [ 4, LxERP.t8('Override') ] ], default=SELF.price_rule.priority, style='width: 300px') %]</td>
21    </tr>
22
23    <tr>
24     <th align="right">[% 'Valid' | $T8 %]</th>
25     <td>[% L.select_tag('price_rule.obsolete', [ [ 0, LxERP.t8('Valid') ], [ 1 , LxERP.t8('Obsolete')]], default=SELF.price_rule.obsolete, title_key='description', style='width: 300px') %]</td>
26    </tr>
27
28    <tr>
29    <tr>
30   </table>
31
32 <h3>[% 'If all of the following match' | $T8 %]:</h3>
33
34 <div id='price_rule_items' style='margin-left: 20px;'>
35   [% FOREACH item = SELF.price_rule.items %]
36      [% PROCESS 'price_rule/item.html' item=item %]
37   [% END %]
38   <div id='price_rule_new_items'></div>
39   <div>[% PROCESS 'price_rule/empty_item.html' %]</div>
40 </div>
41
42 <h3>[% 'Then' | $T8 %]:</h3>
43 <div>[% 'Set (set to)' | $T8 %] [% L.select_tag('price_rule.price_type', SELF.all_price_types, default=SELF.price_rule.price_type) %] [% 'to (set to)' | $T8 %] [% L.input_tag('price_rule.price_or_discount_as_number', SELF.price_rule.price_or_discount_as_number) %] <a id='price_rule_price_type_help' class='interact cursor-help' title='[% 'Price type explanation' | $T8 %]'>[?]</a>
44 </div>
45
46   <p>
47    [% L.hidden_tag("action", "PriceRule/dispatch") %]
48    [% L.hidden_tag("callback", FORM.callback) %]
49    [% L.submit_tag("action_" _  (SELF.price_rule.id ? "update" : "create"), LxERP.t8('Save')) %]
50    [%- IF SELF.price_rule.id %]
51     [% L.submit_tag("action_create", LxERP.t8('Save as new')) %]
52     [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) IF !SELF.price_rule.in_use %]
53    [%- END %]
54    <a href="[% SELF.url_for(action='list', 'filter.type'=SELF.price_rule.type) %]">[%- LxERP.t8('Abort') %]</a>
55   </p>
56  </form>