PriceRule: Erste Version
[kivitendo-erp.git] / templates / webpages / price_rule / form.html
diff --git a/templates/webpages/price_rule/form.html b/templates/webpages/price_rule/form.html
new file mode 100644 (file)
index 0000000..fbe15c5
--- /dev/null
@@ -0,0 +1,62 @@
+[%- USE T8 %]
+[%- USE L %][%- USE P %]
+[%- USE HTML %][%- USE LxERP %]
+
+<h1>[% title %]</h1>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <form method="post" action="controller.pl">
+  [% L.hidden_tag("price_rule.id",   SELF.price_rule.id) %]
+  [% L.hidden_tag("price_rule.type", SELF.price_rule.type) %]
+
+  <table>
+   <tr>
+    <th align="right">[% 'Name' | $T8 %]</th>
+    <td>[% L.input_tag("price_rule.name", SELF.price_rule.name, size=60, class='initial_focus') %]</td>
+   </tr>
+[%- IF 0 %]
+   <tr>
+    <th align="right">[% 'Type' | $T8 %]</th>
+    <td>[% L.select_tag("price_rule.type", [ [ 'sales', LxERP.t8('Sales')], [ 'purchase', LxERP.t8('Purchase') ] ], default=SELF.price_rule.type) %]</td>
+   </tr>
+[%- END %]
+   <tr>
+    <th align="right">[% 'Priority' | $T8 %]</th>
+    <td>[% L.select_tag('price_rule.priority', [1,2,3,4,5], default=SELF.price_rule.priority, style='width: 300px') %]</td>
+   </tr>
+
+   <tr>
+    <th align="right">[% 'Valid' | $T8 %]</th>
+    <td>[% L.select_tag('project.project_type_id', [ [ 0, LxERP.t8('Valid') ], [ 1 , LxERP.t8('Obsolete')]], default=SELF.price_rule.obsolete, title_key='description', style='width: 300px') %]</td>
+   </tr>
+
+   <tr>
+   <tr>
+  </table>
+
+<h3>[% 'If all of the following match' | $T8 %]:</h3>
+
+<div id='price_rule_items' style='margin-left: 20px;'>
+  [% FOREACH item = SELF.price_rule.items %]
+     [% PROCESS 'price_rule/item.html' item=item %]
+  [% END %]
+  <div id='price_rule_new_items'></div>
+  <div>[% PROCESS 'price_rule/empty_item.html' %]</div>
+</div>
+
+<h3>[% 'Then' | $T8 %]:</h3>
+<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) %]
+</div>
+
+  <p>
+   [% L.hidden_tag("action", "PriceRule/dispatch") %]
+   [% L.hidden_tag("callback", FORM.callback) %]
+   [% L.submit_tag("action_" _  (SELF.price_rule.id ? "update" : "create"), LxERP.t8('Save')) %]
+   [%- IF SELF.price_rule.id %]
+    [% L.submit_tag("action_create", LxERP.t8('Save as new')) %]
+    [% 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 %]
+   [%- END %]
+   <a href="[% SELF.url_for(action='list', 'vc'=SELF.price_rule.type) %]">[%- LxERP.t8('Abort') %]</a>
+  </p>
+ </form>