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