From: Jan Büren Date: Wed, 27 Jul 2011 10:51:15 +0000 (+0200) Subject: Zum commit von gerade noch entsprechend employee korrekt ausgelesen und gldate vom... X-Git-Tag: release-2.7.0beta1~347 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3286128e8253b38ae4e996b327beaf243661a5ef;p=kivitendo-erp.git Zum commit von gerade noch entsprechend employee korrekt ausgelesen und gldate vom richtigen Datensatz --- diff --git a/SL/GL.pm b/SL/GL.pm index feac77c50..e1cb7bc5b 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -263,8 +263,6 @@ sub all_transactions { if ($form->{employee} =~ /--/) { ($form->{employee_id},$form->{employee_name}) = split(/--/,$form->{employee}); - $query .= " AND o.employee_id = ?"; - push @values, conv_i($form->{employee_id}); #if ($form->{employee_id}) { $glwhere .= " AND g.employee_id = ? "; $arwhere .= " AND a.employee_id = ? "; @@ -370,7 +368,9 @@ sub all_transactions { CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $columns_for_sorting{gl} - FROM gl g, acc_trans ac $project_join, chart c + FROM gl g + LEFT JOIN employee e ON (g.employee_id = e.id), + acc_trans ac $project_join, chart c LEFT JOIN tax t ON (t.chart_id = c.id) WHERE $glwhere AND (ac.chart_id = c.id) @@ -384,7 +384,9 @@ sub all_transactions { CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $columns_for_sorting{arap} - FROM ar a, acc_trans ac $project_join, customer ct, chart c + FROM ar a + LEFT JOIN employee e ON (a.employee_id = e.id), + acc_trans ac $project_join, customer ct, chart c LEFT JOIN tax t ON (t.chart_id=c.id) WHERE $arwhere AND (ac.chart_id = c.id) @@ -399,7 +401,9 @@ sub all_transactions { CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee $project_columns $columns_for_sorting{arap} - FROM ap a, acc_trans ac $project_join, vendor ct, chart c + FROM ap a + LEFT JOIN employee e ON (a.employee_id = e.id), + acc_trans ac $project_join, vendor ct, chart c LEFT JOIN tax t ON (t.chart_id=c.id) WHERE $apwhere AND (ac.chart_id = c.id) diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index b8c288118..6d2b0a559 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -511,7 +511,7 @@ sub generate_report { gldate transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno - credit_tax credit_tax_accno projectnumbers balance + credit_tax credit_tax_accno projectnumbers balance employee ); # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table @@ -658,9 +658,9 @@ sub generate_report { $row->{balance}->{data} = $data; $row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} }; - map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes); + map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee); - map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate gldate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source); + map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source); foreach my $col (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno)) { $row->{$col}->{link} = [ map { "${callback}&accno=" . E($_) } @{ $rows{$col} } ];