[%- USE T8 %]
[%- USE HTML %]
[%- USE L %]
[%- USE LxERP %][%- USE P -%]
[%- BLOCK cvar_inputs %]
[%- SET render_cvar_tag_options = {};
render_cvar_tag_options.import(cvar_tag_options) IF cvar_tag_options;
SET cvar_tag_name = HTML.escape(cvar.name_prefix) _ "cvar_" _ HTML.escape(cvar.var.name) _ HTML.escape(cvar.name_postfix);
IF !render_cvar_tag_options.id && (cvar.var.type != 'select');
SET render_cvar_tag_options.no_id = 1;
END;
%]
[%- IF (!cvar.hide_non_editable || cvar.var.flag_editable) && !cvar.partsgroup_filtered %]
[%- IF !cvar.valid %]
[%- IF show_disabled_message %]
[% 'Element disabled' | $T8 %]
[%- END %]
[%- ELSIF cvar.var.type == 'bool' %]
[%- render_cvar_tag_options.import(checked=cvar.value, value=1);
L.checkbox_tag(cvar_tag_name, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'textfield' %]
[% render_cvar_tag_options.import(cols=cvar.var.width, rows=cvar.var.height);
L.textarea_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'date' %]
[%- L.date_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'timestamp' %]
[%- L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'select' %]
[%- render_cvar_tag_options.name=cvar_tag_name %]
[%- ELSIF cvar.var.type == 'customer' %]
[%- render_cvar_tag_options.type = 'customer' %]
[%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'vendor' %]
[%- render_cvar_tag_options.type = 'vendor' %]
[%- L.customer_vendor_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'part' %]
[% L.part_picker(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- ELSIF cvar.var.type == 'number' %]
[%- L.input_tag(cvar_tag_name, LxERP.format_amount(cvar.value, -2), render_cvar_tag_options) %]
[%- ELSE %]
[% render_cvar_tag_options.maxlength=cvar.var.maxlength IF cvar.var.maxlength;
L.input_tag(cvar_tag_name, cvar.value, render_cvar_tag_options) %]
[%- END %]
[%- END %]
[%- END %]