Revision 5fea7d82
Von Jan Büren vor mehr als 3 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
526 | 526 |
if ($form->{bom} eq '2' && $form->{l_assembly}) { |
527 | 527 |
# nuke where clause and bind vars |
528 | 528 |
$where_clause = ' 1=1 AND p.id in (SELECT id from assembly where parts_id IN ' . |
529 |
' (select id from parts where 1=1 AND ';
|
|
529 |
' (select id from parts where 1=1'; |
|
530 | 530 |
@bind_vars = (); |
531 | 531 |
# use only like filter for items used in assemblies |
532 | 532 |
foreach (@like_filters) { |
533 | 533 |
next unless $form->{$_}; |
534 | 534 |
$form->{"l_$_"} = '1'; # show the column |
535 |
$where_clause .= " $_ ILIKE ? "; |
|
535 |
$where_clause .= " AND $_ ILIKE ? ";
|
|
536 | 536 |
push @bind_vars, like($form->{$_}); |
537 | 537 |
} |
538 | 538 |
$where_clause .='))'; |
... | ... | |
547 | 547 |
$order_clause |
548 | 548 |
$limit_clause |
549 | 549 |
SQL |
550 |
|
|
551 | 550 |
$form->{parts} = selectall_hashref_query($form, $dbh, $query, @bind_vars); |
552 | 551 |
|
553 | 552 |
map { $_->{onhand} *= 1 } @{ $form->{parts} }; |
Auch abrufbar als: Unified diff
zu 52f5223a1dcf, mehr als einen Filter im SQL-Statement erlauben