X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIC.pm;h=f36ca04855b952fb96481f7002e756c0dc1ea840;hb=37d14c11afd10049be58467770499b25268c1364;hp=5ddf2c8625fcfed11dc0a48230e1d0b6f3bb67c8;hpb=d1054383fa90478db0424f5dc255d5836bc494d7;p=kivitendo-erp.git 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} };