X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FWH.pm;h=70f1037c29ba937e18b9121f700bf11bc0535a8c;hb=58b90d2d1159a4564f4ef0533669a506442e88eb;hp=00220f24531fcc79228b631aa403135170357902;hpb=83914eeb2e95cdf587565952eef54be59dd58693;p=kivitendo-erp.git diff --git a/SL/WH.pm b/SL/WH.pm index 00220f245..70f1037c2 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -98,7 +98,7 @@ sub transfer { push @values, "$transfer->{comment}"; - $qty = $transfer->{qty}; + my $qty = $transfer->{qty}; if ($transfer->{unit}) { my $partunit = $partunits{$transfer->{parts_id}}; @@ -161,7 +161,7 @@ sub get_warehouse_journal { } if ($filter{chargenumber}) { - push @filter_ary, "w1.chargenumber ILIKE ?"; + push @filter_ary, "i1.chargenumber ILIKE ?"; push @filter_vars, '%' . $filter{chargenumber} . '%'; } @@ -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 =