From 5fea7d824ad41bb81f6ed50c529783984718ad96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 31 Mar 2021 06:46:12 +0000 Subject: [PATCH] zu 52f5223a1dcf, mehr als einen Filter im SQL-Statement erlauben --- SL/IC.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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} }; -- 2.20.1