X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIC.pm;h=ce3bc00a8ea9ed4ef48aba1ceb1f9c4faf5359b5;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=d352a560d64146b023732e54f2735232fb6e2bc5;hpb=65d2537d658b99b005a18c6663bc1293b41a1d83;p=kivitendo-erp.git diff --git a/SL/IC.pm b/SL/IC.pm index d352a560d..ce3bc00a8 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -379,12 +379,20 @@ sub all_parts { push @select_tokens, $_; } - for ($form->{searchitems}) { - push @where_tokens, "p.part_type = 'part'" if /part/; - push @where_tokens, "p.part_type = 'service'" if /service/; - push @where_tokens, "p.part_type = 'assembly'" if /assembly/; - push @where_tokens, "p.part_type = 'assortment'" if /assortment/; + # Oder Bedingungen fuer Ware Dienstleistung Erzeugnis: + if ($form->{l_part} || $form->{l_assembly} || $form->{l_service} || $form->{l_assortment}) { + my @or_tokens = (); + push @or_tokens, "p.part_type = 'service'" if $form->{l_service}; + push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly}; + push @or_tokens, "p.part_type = 'part'" if $form->{l_part}; + push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment}; + push @where_tokens, join ' OR ', map { "($_)" } @or_tokens; } + else { + # gar keine Teile + push @where_tokens, q|'F' = 'T'|; + } + if ( $form->{classification_id} > 0 ) { push @where_tokens, "p.classification_id = ?"; push @bind_vars, $form->{classification_id}; @@ -1135,6 +1143,7 @@ sub prepare_parts_for_printing { my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type); push @{ $template_arrays{part_type} }, $type_abbr; push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id); + push @{ $template_arrays{separate} }, $::request->presenter->separate_abbreviation($prt->classification_id); } $main::lxdebug->leave_sub();