From 3f4f01dcd306d7ebb51a1186d722e6aecd237003 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 29 Apr 2013 13:12:16 +0200 Subject: [PATCH] Buchungsjournal: Filter "Bearbeiter" gefixt Behebt #2248. --- SL/GL.pm | 4 +--- bin/mozilla/gl.pl | 6 ++++-- templates/webpages/gl/search.html | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/GL.pm b/SL/GL.pm index 10d6ee120..1fc1f3a42 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -285,9 +285,7 @@ sub all_transactions { push(@apvalues, '%' . $form->{description} . '%'); } - if ($form->{employee} =~ /--/) { - ($form->{employee_id},$form->{employee_name}) = split(/--/,$form->{employee}); - #if ($form->{employee_id}) { + if ($form->{employee_id}) { $glwhere .= " AND g.employee_id = ? "; $arwhere .= " AND a.employee_id = ? "; $apwhere .= " AND a.employee_id = ? "; diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 626d68817..0d9a92b5d 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -304,19 +304,21 @@ sub generate_report { ); # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table - my @hidden_variables = qw(accno source reference department description notes project_id datefrom dateto employee datesort category l_subtotal); + my @hidden_variables = qw(accno source reference department description notes project_id datefrom dateto employee_id datesort category l_subtotal); push @hidden_variables, map { "l_${_}" } @columns; foreach ( @hidden_variables ) { print URL "$_\n"; }; + my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : ''; + my (@options, @date_options); push @options, $locale->text('Account') . " : $form->{accno} $form->{account_description}" if ($form->{accno}); push @options, $locale->text('Source') . " : $form->{source}" if ($form->{source}); push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference}); push @options, $locale->text('Description') . " : $form->{description}" if ($form->{description}); push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes}); - push @options, $locale->text('Employee') . " : $form->{employee_name}" if ($form->{employee_name}); + push @options, $locale->text('Employee') . " : $employee" if $employee; my $datesorttext = $form->{datesort} eq 'transdate' ? $locale->text('Invoice Date') : $locale->text('Booking Date'); push @date_options, "$datesorttext" if ($form->{datesort} and ($form->{datefrom} or $form->{dateto})); push @date_options, $locale->text('From'), $locale->date(\%myconfig, $form->{datefrom}, 1) if ($form->{datefrom}); diff --git a/templates/webpages/gl/search.html b/templates/webpages/gl/search.html index 3f1fd404d..e7f1cd1b7 100644 --- a/templates/webpages/gl/search.html +++ b/templates/webpages/gl/search.html @@ -42,7 +42,7 @@ [% 'Employee' | $T8 %] - [% L.select_tag('employee', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1) %] + [% L.select_tag('employee_id', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1) %] [% 'Filter date by' | $T8 %] -- 2.20.1