Buchungsjournal: Filter "Bearbeiter" gefixt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 29 Apr 2013 11:12:16 +0000 (13:12 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 29 Apr 2013 11:12:16 +0000 (13:12 +0200)
Behebt #2248.

SL/GL.pm
bin/mozilla/gl.pl
templates/webpages/gl/search.html

index 10d6ee1..1fc1f3a 100644 (file)
--- 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 = ? ";
index 626d688..0d9a92b 100644 (file)
@@ -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});
index 3f1fd40..e7f1cd1 100644 (file)
@@ -42,7 +42,7 @@
         </tr>
  <tr>
     <th align=right>[% 'Employee' | $T8 %]</th>
-    <td colspan=3>[% L.select_tag('employee', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1) %]</td>
+    <td colspan=3>[% L.select_tag('employee_id', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1) %]</td>
   </tr>
   <tr>
     <th align=right>[% 'Filter date by' | $T8 %]</th>