From: Jan Büren Date: Wed, 31 Mar 2021 06:46:12 +0000 (+0000) Subject: zu 52f5223a1dcf, mehr als einen Filter im SQL-Statement erlauben X-Git-Tag: kivitendo-mebil_0.1-0~9^2~394 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5fea7d824ad41bb81f6ed50c529783984718ad96;p=kivitendo-erp.git zu 52f5223a1dcf, mehr als einen Filter im SQL-Statement erlauben --- diff --git a/SL/IC.pm b/SL/IC.pm index 5ddf2c862..f36ca0485 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -526,13 +526,13 @@ sub all_parts { if ($form->{bom} eq '2' && $form->{l_assembly}) { # nuke where clause and bind vars $where_clause = ' 1=1 AND p.id in (SELECT id from assembly where parts_id IN ' . - ' (select id from parts where 1=1 AND '; + ' (select id from parts where 1=1'; @bind_vars = (); # use only like filter for items used in assemblies foreach (@like_filters) { next unless $form->{$_}; $form->{"l_$_"} = '1'; # show the column - $where_clause .= " $_ ILIKE ? "; + $where_clause .= " AND $_ ILIKE ? "; push @bind_vars, like($form->{$_}); } $where_clause .='))'; @@ -547,7 +547,6 @@ sub all_parts { $order_clause $limit_clause SQL - $form->{parts} = selectall_hashref_query($form, $dbh, $query, @bind_vars); map { $_->{onhand} *= 1 } @{ $form->{parts} };