From 4895d0c67367abacd4961ba8ed3f3baf8b16a036 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 25 Jun 2008 16:09:06 +0000 Subject: [PATCH] =?utf8?q?Lagerbericht:=20Bei=20der=20Auswahl=20der=20Keys?= =?utf8?q?=20aus=20$form,=20die=20f=C3=BCr=20die=20Auswahl=20der=20aus=20d?= =?utf8?q?en=20Tabellen=20auszulesenden=20Spalten=20verwantwortlich=20sind?= =?utf8?q?,=20strenger=20sein.=20Der=20Key=20muss=20mit=20"l=5F"=20beginne?= =?utf8?q?n.=20Wird=20"l=5F"=20auch=20in=20der=20Mitte=20zugelassen,=20so?= =?utf8?q?=20schl=C3=A4gt=20dies=20fehl,=20wenn=20per=20ReportGenerator=20?= =?utf8?q?exportiert=20wird.=20Grund=20ist,=20dass=20diese=20Variablen=20a?= =?utf8?q?uch=20nochmal=20mit=20dem=20Pr=C3=A4fix=20"report=5Fgenerator=5F?= =?utf8?q?hidden=5F*"=20in=20$form=20vorhanden=20sind.=20Dadurch=20w=C3=BC?= =?utf8?q?rden=20Spalten=20selektiert,=20die=20es=20in=20der=20Datenbank?= =?utf8?q?=20nicht=20gibt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/WH.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SL/WH.pm b/SL/WH.pm index 00220f245..66bf3feab 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -240,12 +240,12 @@ sub get_warehouse_journal { # build the select clauses. # take all the requested ones from the first hash and overwrite them from the out/in hashes if present. for my $i ('trans', 'out', 'in') { - $select{$i} = join ', ', map { +/l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" } - ( grep( { !/qty$/ and /l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_itime) ); + $select{$i} = join ', ', map { +/^l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" } + ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_itime) ); } my $group_clause = join ", ", map { +/^l_/; "r_$'" } - ( grep( { !/qty$/ and /l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_itime) ); + ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_itime) ); my $query = qq|SELECT DISTINCT $select{trans} @@ -434,12 +434,12 @@ sub get_warehouse_report { "warehousedescription" => "w.description", "partunit" => "p.unit", ); - my $select_clause = join ', ', map { +/l_/; "$select_tokens{$'} AS $'" } - ( grep( { !/qty/ and /l_/ and $form->{$_} eq 'Y' } keys %$form), + my $select_clause = join ', ', map { +/^l_/; "$select_tokens{$'} AS $'" } + ( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit) ); my $group_clause = join ", ", map { +/^l_/; "$'" } - ( grep( { !/qty/ and /l_/ and $form->{$_} eq 'Y' } keys %$form), + ( grep( { !/qty/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit) ); my $query = -- 2.20.1