if (!$main::auth->assert('sales_all_edit', 1)) {
# only show own invoices
$where .= " AND a.employee_id = (select id from employee where login= ?)";
- push (@values, $form->{login});
+ push (@values, $::myconfig{login});
} else {
if ($form->{employee_id}) {
$where .= " AND a.employee_id = ?";
}
};
+ my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT',
+ 'trans_id_field' => 'c.id',
+ 'filter' => $form,
+ );
+ if ($cvar_where) {
+ $where .= qq| AND ($cvar_where)|;
+ push @values, @cvar_values;
+ }
+
my @a = qw(transdate invnumber name);
push @a, "employee" if $form->{l_employee};
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';