From 72f25b5383e66ac43ffb0eeabdcc989f9ac4cb10 Mon Sep 17 00:00:00 2001 From: Bernd Blessmann Date: Tue, 1 Jun 2010 10:38:46 +0200 Subject: [PATCH] Einige Warnungen wg. unitizialisierter Variablen abgefangen. --- SL/WH.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SL/WH.pm b/SL/WH.pm index b164a3064..a2df9f3b4 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -99,7 +99,8 @@ sub transfer { } else { push @values, $transfer_types{$directions[$direction]}->{$transfer->{transfer_type}}; } - + + $transfer->{comment} = defined($transfer->{comment}) ? $transfer->{comment} : ''; push @values, "$transfer->{comment}"; my $qty = $transfer->{qty}; @@ -279,12 +280,12 @@ sub get_warehouse_journal { # filters my (@filter_ary, @filter_vars, $joins, %select_tokens, %select); - if ($filter{warehouse_id} ne '') { + if ($filter{warehouse_id}) { push @filter_ary, "w1.id = ? OR w2.id = ?"; push @filter_vars, $filter{warehouse_id}, $filter{warehouse_id}; } - if ($filter{bin_id} ne '') { + if ($filter{bin_id}) { push @filter_ary, "b1.id = ? OR b2.id = ?"; push @filter_vars, $filter{bin_id}, $filter{bin_id}; } @@ -396,6 +397,8 @@ sub get_warehouse_journal { 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) ); + $where_clause = defined($where_clause) ? $where_clause : ''; + $main::lxdebug->message(0, "where_clause = ".$where_clause); my $query = qq|SELECT DISTINCT $select{trans} FROM inventory i1 -- 2.20.1