314 |
314 |
|
315 |
315 |
# special case smart search
|
316 |
316 |
if ($form->{all}) {
|
317 |
|
$form->{"l_$_"} = 1 for qw(partnumber description unit sellprice lastcost linetotal);
|
318 |
|
$form->{l_service} = 1 if $form->{searchitems} eq 'service' || $form->{searchitems} eq '';
|
319 |
|
$form->{l_assembly} = 1 if $form->{searchitems} eq 'assembly' || $form->{searchitems} eq '';
|
320 |
|
$form->{l_part} = 1 if $form->{searchitems} eq 'part' || $form->{searchitems} eq '';
|
321 |
|
$form->{l_assortment} = 1 if $form->{searchitems} eq 'assortment' || $form->{searchitems} eq '';
|
|
317 |
$form->{"l_$_"} = 1 for qw(partnumber description unit sellprice lastcost linetotal);
|
|
318 |
$form->{l_service} = 1 if $form->{searchitems} eq 'service' || $form->{searchitems} eq '';
|
|
319 |
$form->{l_assembly} = 1 if $form->{searchitems} eq 'assembly' || $form->{searchitems} eq '';
|
|
320 |
$form->{l_part} = 1 if $form->{searchitems} eq 'part' || $form->{searchitems} eq '';
|
|
321 |
$form->{l_assortment} = 1 if $form->{searchitems} eq 'assortment' || $form->{searchitems} eq '';
|
|
322 |
$form->{l_parent_variant} = 1 if $form->{searchitems} eq 'parent_variant' || $form->{searchitems} eq '';
|
|
323 |
$form->{l_variant} = 1 if $form->{searchitems} eq 'variant' || $form->{searchitems} eq '';
|
322 |
324 |
push @where_tokens, "p.partnumber ILIKE ? OR p.description ILIKE ?";
|
323 |
325 |
push @bind_vars, (like($form->{all})) x 2;
|
324 |
326 |
}
|
... | ... | |
368 |
370 |
}
|
369 |
371 |
|
370 |
372 |
# Oder Bedingungen fuer Ware Dienstleistung Erzeugnis:
|
371 |
|
if ($form->{l_part} || $form->{l_assembly} || $form->{l_service} || $form->{l_assortment}) {
|
372 |
|
my @or_tokens = ();
|
373 |
|
push @or_tokens, "p.part_type = 'service'" if $form->{l_service};
|
374 |
|
push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly};
|
375 |
|
push @or_tokens, "p.part_type = 'part'" if $form->{l_part};
|
376 |
|
push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment};
|
377 |
|
push @where_tokens, join ' OR ', map { "($_)" } @or_tokens;
|
|
373 |
if ( $form->{l_part} || $form->{l_assembly}
|
|
374 |
|| $form->{l_service} || $form->{l_assortment}
|
|
375 |
|| $form->{l_parent_variant} || $form->{l_variant}
|
|
376 |
) {
|
|
377 |
my @or_tokens = ();
|
|
378 |
push @or_tokens, "p.part_type = 'service'" if $form->{l_service};
|
|
379 |
push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly};
|
|
380 |
push @or_tokens, "p.part_type = 'part'" if $form->{l_part};
|
|
381 |
push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment};
|
|
382 |
push @or_tokens, "p.part_type = 'parent_variant'" if $form->{l_parent_variant};
|
|
383 |
push @or_tokens, "p.part_type = 'variant'" if $form->{l_variant};
|
|
384 |
push @where_tokens, join ' OR ', map { "($_)" } @or_tokens;
|
378 |
385 |
}
|
379 |
386 |
else {
|
380 |
387 |
# gar keine Teile
|
Varianten: zum Bericht Artikel hinzugefügt