From: Sven Schöling Date: Thu, 3 Sep 2009 15:02:17 +0000 (+0200) Subject: Kosmetik X-Git-Tag: release-2.6.1beta1~300 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=93618a69a94243bf03ed2a9e856d8d4e67036394;p=kivitendo-erp.git Kosmetik --- diff --git a/SL/IC.pm b/SL/IC.pm index 0ce8ff492..eaa932c00 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -829,8 +829,8 @@ sub all_parts { # column name, prefix, joins_needed [ 'description', 'ioi.', 'invoice_oi' ], [ 'deliverydate', 'ioi.', 'invoice_oi' ], - [ 'transdate' , 'apoe.', 'apoe' ], - [ 'unit' , 'ioi.', 'invoice_oi' ], + [ 'transdate', 'apoe.', 'apoe' ], + [ 'unit', 'ioi.', 'invoice_oi' ], ); # careful with renames. these are HARD, and any filters done on the original column will break @@ -846,18 +846,18 @@ sub all_parts { my $make_token_builder = sub { my $joins_needed = shift; sub { - my ($col, $group) = @_; + my ($col, $alias) = @_; my @coalesce_tokens = map { ($_->[1] || 'p.') . $_->[0] } grep { !$_->[2] || $joins_needed->{$_->[2]} } - grep { $_->[0] eq $col } + grep { $_->[0] eq $col } @column_override, [ $col, $table_prefix{$col} ]; my $coalesce = scalar @coalesce_tokens > 1; return ($coalesce ? sprintf 'COALESCE(%s)', join ', ', @coalesce_tokens : shift @coalesce_tokens) - . ($group && ($coalesce || $renamed_columns{$col}) + . ($alias && ($coalesce || $renamed_columns{$col}) ? " AS " . ($renamed_columns{$col} || $col) : ''); }