X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FAR.pm;h=81be410e819f7d490d57c233be811c26a37aa2e0;hb=0b8b24545c98eb4cf22bda155d0e7efbf2bdcdb7;hp=692967fae01a3024dad8c82fb3cacdef5b79bb3f;hpb=b98b8e3f73a399d2d4df7be4962b56bd4ad8c82b;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index 692967fae..81be410e8 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -302,8 +302,6 @@ sub post_transaction { exporttype => DATEV_ET_BUCHUNGEN, format => DATEV_FORMAT_KNE, dbh => $dbh, - from => $transdate, - to => $transdate, trans_id => $form->{id}, ); @@ -561,7 +559,7 @@ sub ar_transactions { 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 = ?"; @@ -573,6 +571,15 @@ sub ar_transactions { } }; + 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';