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();
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cvar_configs = CVar->get_configs('module' => 'IC');
-
$form->{title} = $locale->text("Report about warehouse contents");
$form->{sort} ||= 'partnumber';
my $sort_col = $form->{sort};
my $report = SL::ReportGenerator->new(\%myconfig, $form);
+ my $cvar_configs = CVar->get_configs('module' => 'IC');
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
'list_price' => { 'text' => $locale->text('List Price'), },
);
+ my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
+ %column_defs = (%column_defs, %column_defs_cvars);
+
my $href = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
$href .= "&maxrows=".$form->{maxrows};
- my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
- %column_defs = (%column_defs, %column_defs_cvars);
map { $column_defs{$_}->{link} = $href . "&page=".$page."&sort=${_}&order=" . Q($_ eq $sort_col ? 1 - $form->{order} : $form->{order}) } @columns;