30c0e6060e31a3575addd6d27bd0ef010cc58409
[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 [%- IF 0 %]
19    <tr>
20     <th align="right">[% 'Type' | $T8 %]</th>
21     <td>[% L.select_tag("price_rule.type", [ [ 'sales', LxERP.t8('Sales')], [ 'purchase', LxERP.t8('Purchase') ] ], default=SELF.price_rule.type) %]</td>
22    </tr>
23 [%- END %]
24    <tr>
25     <th align="right">[% 'Priority' | $T8 %]</th>
26     <td>[% L.select_tag('price_rule.priority', [ [3, LxERP.t8('Normal') ], [ 4, LxERP.t8('Override') ] ], default=SELF.price_rule.priority, style='width: 300px') %]</td>
27    </tr>
28
29    <tr>
30     <th align="right">[% 'Valid' | $T8 %]</th>
31     <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>
32    </tr>
33
34    <tr>
35    <tr>
36   </table>
37
38 <h3>[% 'If all of the following match' | $T8 %]:</h3>
39
40 <div id='price_rule_items' style='margin-left: 20px;'>
41   [% FOREACH item = SELF.price_rule.items %]
42      [% PROCESS 'price_rule/item.html' item=item %]
43   [% END %]
44   <div id='price_rule_new_items'></div>
45   <div>[% PROCESS 'price_rule/empty_item.html' %]</div>
46 </div>
47
48 <h3>[% 'Then' | $T8 %]:</h3>
49 <div>[% 'Set (set to)' | $T8 %] [% L.select_tag('price_rule.price_or_discount', [ [0, LxERP.t8('Price') ], [1, LxERP.t8('Discount') ]], default=SELF.price_rule.price_or_discount) %] [% 'to (set to)' | $T8 %] [% L.input_tag('price_rule.price_or_discount_as_number', SELF.price_rule.price_or_discount_as_number) %]
50 </div>
51
52   <p>
53    [% L.hidden_tag("action", "PriceRule/dispatch") %]
54    [% L.hidden_tag("callback", FORM.callback) %]
55    [% L.submit_tag("action_" _  (SELF.price_rule.id ? "update" : "create"), LxERP.t8('Save')) %]
56    [%- IF SELF.price_rule.id %]
57     [% L.submit_tag("action_create", LxERP.t8('Save as new')) %]
58     [% 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 %]
59    [%- END %]
60    <a href="[% SELF.url_for(action='list', 'vc'=SELF.price_rule.type) %]">[%- LxERP.t8('Abort') %]</a>
61   </p>
62  </form>