"price_factors" => "ALL_PRICE_FACTORS");
# label subs
- $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]);
- $TMPL_VAR{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]);
+ my $employee_list_query_gen = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
+ $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('employee_id'));
+ $TMPL_VAR{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => $employee_list_query_gen->('salesman_id'));
$TMPL_VAR{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [
or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ]
]);