X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/b320453d39fd9ff512debf8c76e770a59aadfa6d..dd27c96958cef43ee999f9fdaa167cc03a6814ed:/SL/AR.pm diff --git a/SL/AR.pm b/SL/AR.pm index 11333cef0..a2512c8aa 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -490,10 +490,21 @@ sub ar_transactions { } } - if (!$main::auth->assert('sales_all_edit', 1)) { + 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}); - } + } else { + if ($form->{employee_id}) { + $where .= " AND a.employee_id = ?"; + push @values, conv_i($form->{employee_id}); + } + if ($form->{salesman_id}) { + $where .= " AND a.salesman_id = ?"; + push @values, conv_i($form->{salesman_id}); + } + }; + my @a = qw(transdate invnumber name); push @a, "employee" if $form->{l_employee}; my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';