[%- USE T8 %]
[%- USE HTML %]
[%- USE L %]
[%- USE LxERP %]
[%- DEFAULT var_name = HTML.escape(cvar_name_prefix) _ HTML.escape(var.config.name) _ HTML.escape(cvar_name_postfix) %]
[%- IF ( hide_non_editable && !var.config.is_flag('editable') ) %]
[% L.hidden_tag(var_name, var.value) %]
[%- ELSIF ( !var.is_valid ) %]
[%- IF ( show_disabled_message ) %]
[% 'Element disabled' | $T8 %]
[%- END %]
[%- ELSIF ( var.config .type == 'bool' ) %]
[% L.checkbox_tag(var_name, checked = var.value) %]
[%- ELSIF ( var.config .type == 'textfield' ) %]
[% L.textarea_tag(var_name, var.value, cols = var.config.processed_options.WIDTH, rows = var.config.processed_options.HEIGHT) %]
[%- ELSIF ( var.config.type == 'date' ) %]
[% L.date_tag(var_name, var.value) %]
[%- ELSIF ( var.config.type == 'timestamp' ) %]
[% L.input_tag(var_name, var.value) %]
[%- ELSIF ( var.config.type == 'customer' ) %]
[% L.customer_vendor_picker(var_name, var.value, type='customer') %]
[%- ELSIF ( var.config.type == 'vendor' ) %]
[% L.customer_vendor_picker(var_name, var.value, type='vendor') %]
[%- ELSIF ( var.config.type == 'part' ) %]
[% L.part_picker(var_name, var.value) %]
[%- ELSIF ( var.config.type == 'select' ) %]
[% L.select_tag(var_name, var.config.processed_options, default = var.value) %]
[%- ELSIF ( var.config.type == 'number' ) %]
[%- L.input_tag(var_name, LxERP.format_amount(var.value, -2)) %]
[%- ELSE %]
[% L.input_tag(var_name, var.value, maxlength = var.config.processed_options.MAXLENGTH) %]
[%- END %]