291650786f8624355ccfd480d278187a60ac5673
[kivitendo-erp.git] / templates / webpages / price_rule / item.html
1 [%- USE L %]
2 [%- USE P %]
3 [%- USE HTML %]
4 [%- USE T8 %]
5 [%- USE LxERP %]
6 [% SET num_compare_ops = [
7   [ 'eq', LxERP.t8('is equal to') ],
8   [ 'le', LxERP.t8('is lower than or equal') ],
9   [ 'ge', LxERP.t8('is greater than or equal') ],
10 ] %]
11 [% SET date_compare_ops = [
12   [ 'eq', LxERP.t8('is equal to') ],
13   [ 'gt', LxERP.t8('is after') ],
14   [ 'lt', LxERP.t8('is before') ],
15 ] %]
16 <div>
17 <a class='price_rule_remove_line interact cursor-pointer'>✘</a>
18 [% L.hidden_tag('price_rule.items[+].id', item.id) %]
19 [% L.hidden_tag('price_rule.items[].type', item.type) %]
20 [%- SWITCH item.type %]
21   [% CASE 'part' %]
22     [% 'Part' | $T8 %] [% 'is' | $T8 %] [% P.part.picker('price_rule.items[].value_int', item.part) %]
23   [% CASE 'customer' %]
24     [% 'Customer' | $T8 %] [% 'is' | $T8 %] [% P.customer_vendor.picker('price_rule.items[].value_int', item.customer, type='customer') %]
25   [% CASE 'vendor' %]
26     [% 'Vendor' | $T8 %] [% 'is' | $T8 %] [% P.customer_vendor.picker('price_rule.items[].value_int', item.vendor, type='vendor') %]
27   [% CASE 'business' %]
28     [% 'Type of Business' | $T8 %] [% 'is' | $T8 %] [% L.select_tag('price_rule.items[].value_int', SELF.businesses, title_key='description', default=item.value_int) %]
29   [% CASE 'partsgroup' %]
30     [% 'Partsgroup' | $T8 %] [% 'is' | $T8 %] [% L.select_tag('price_rule.items[].value_int', SELF.partsgroups, title_key='partsgroup', default=item.value_int) %]
31   [% CASE 'qty' %]
32     [% 'Quantity' | $T8 %] [% L.select_tag('price_rule.items[].op', num_compare_ops, default=item.op) %] [% L.input_tag('price_rule.items[].value_num_as_number', item.value_num_as_number) %]
33   [% CASE 'reqdate' %]
34     [% 'Reqdate' | $T8 %] [% L.select_tag('price_rule.items[].op', date_compare_ops, default=item.op) %] [% L.date_tag('price_rule.items[].value_date', item.value_date) %]
35   [% CASE 'transdate' %]
36     [% 'Transdate Record' | $T8 %] [% L.select_tag('price_rule.items[].op', date_compare_ops, default=item.op) %] [% L.date_tag('price_rule.items[].value_date', item.value_date) %]
37   [% CASE 'pricegroup' %]
38     [% 'Pricegroup' | $T8 %] [% 'is' | $T8 %] [% L.select_tag('price_rule.items[].value_int', SELF.pricegroups, title_key='pricegroup', default=item.value_int) %]
39   [% CASE %]
40 [%- END %]
41 </div>