5 [%- USE LxERP %][%- USE P -%]
6 [%- BLOCK cvar_inputs %]
7 [%- SET render_cvar_tag_options = {};
8 render_cvar_tag_options.import(cvar_tag_options) IF cvar_tag_options;
9 SET cvar_tag_name = HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix);
10 IF !render_cvar_tag_options.id && (cvar.var.type != 'select');
11 SET render_cvar_tag_options.no_id = 1;
15 [%- IF (!cvar.hide_non_editable || cvar.var.flag_editable) && !cvar.partsgroup_filtered %]
18 [%- IF show_disabled_message %]
19 <i>[% 'Element disabled' | $T8 %]</i>
22 [%- ELSIF cvar.var.type == 'bool' %]
23 [%- render_cvar_tag_options.import(checked=cvar.value, value=1);
24 L.checkbox_tag(cvar_tag_name, render_cvar_tag_options) %]
26 [%- ELSIF cvar.var.type == 'textfield' %]
27 [% render_cvar_tag_options.import(cols=cvar.var.width, rows=cvar.var.height);
28 L.textarea_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
30 [%- ELSIF cvar.var.type == 'date' %]
31 [%- L.date_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
33 [%- ELSIF cvar.var.type == 'timestamp' %]
34 [%- L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
36 [%- ELSIF cvar.var.type == 'select' %]
37 [%- render_cvar_tag_options.name=cvar_tag_name %]
38 <select [% P.stringify_attributes(render_cvar_tag_options) %]>
39 [%- IF LxERP.is_rdbo(cvar.var, 'CustomVariableConfig') %]
40 [%- FOREACH option = cvar.var.processed_options %]
41 [%- SET render_cvar_opts = {
44 render_cvar_opts.selected = 'selected' IF option == cvar.value;
45 L.html_tag('option', option, render_cvar_opts) %]
48 [%- FOREACH option = cvar.var.OPTIONS %]
49 [%- SET render_cvar_opts = {
52 render_cvar_opts.selected = 'selected' IF option.value == cvar.value;
53 L.html_tag('option', option.value, render_cvar_opts) %]
58 [%- ELSIF cvar.var.type == 'customer' %]
59 [%- render_cvar_tag_options.type = 'customer' %]
60 [%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
62 [%- ELSIF cvar.var.type == 'vendor' %]
63 [%- render_cvar_tag_options.type = 'vendor' %]
64 [%- P.customer_vendor.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
66 [%- ELSIF cvar.var.type == 'part' %]
67 [% P.part.picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
69 [%- ELSIF cvar.var.type == 'number' %]
70 [%- L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %]
73 [% render_cvar_tag_options.maxlength=cvar.var.maxlength IF cvar.var.maxlength;
74 L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]