$form->{l_part_type} = 'Y';
my $select_clause = join ', ', map { +/^l_/; "$select_tokens{$'} AS $'" }
- ( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
+ ( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
qw(l_parts_id l_qty l_partunit) );
my $group_clause = join ", ", map { +/^l_/; "$'" }
- ( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
+ ( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
qw(l_parts_id l_partunit) );
my %join_tokens = (
);
my $joins = join ' ', grep { $_ } map { +/^l_/; $join_tokens{"$'"} }
- ( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
+ ( grep( { !/qty/ and !/^l_cvar/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form),
qw(l_parts_id l_qty l_partunit) );
my $query =
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
- my $CVAR_CONFIGS = SL::DB::Manager::CustomVariableConfig->get_all_sorted(where => [ module => 'IC' ]);
- my $INCLUDABLE_CVAR_CONFIGS = [ grep { $_->includeable } @{ $CVAR_CONFIGS } ];
+ my $cvar_configs = CVar->get_configs('module' => 'IC');
+ (undef,
+ $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $cvar_configs,
+ 'include_prefix' => 'l_',
+ 'include_value' => 'Y');
$form->{title} = $locale->text("Report about warehouse contents");
print $form->parse_html_template("wh/report_filter",
{ "WAREHOUSES" => $form->{WAREHOUSES},
"UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)),
- # "CVAR_CONFIGS" => $CVAR_CONFIGS, # nyi searchable cvars
- "INCLUDABLE_CVAR_CONFIGS" => $INCLUDABLE_CVAR_CONFIGS,
});
$main::lxdebug->leave_sub();
<td align="right"><input name="l_list_price" id="l_list_price" class="checkbox" type="checkbox" value="Y"></td>
<td nowrap><label for="l_list_price">[% 'List Price' | $T8 %]</label></td>
</tr>
- [% IF INCLUDABLE_CVAR_CONFIGS %]
- <tr><td colspan="6"><hr noshade height="1"></td></tr>
- [% FOREACH cvar_cfg = INCLUDABLE_CVAR_CONFIGS %]
- <tr>
- <td colspan="2" align="left">
- [% name__ = cvar_cfg.name;
- L.checkbox_tag("l_cvar_" _ name__, value="1", checked=(cvar_cfg.included_by_default ? 1 : ''), label=cvar_cfg.description) %]
- </td>
- </tr>
- [% END %]
- [% END %]
+ </table>
+ <table>
+ [% CUSTOM_VARIABLES_INCLUSION_CODE %]
</table>
</td>
</tr>