X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FManager%2FPart.pm;h=0b751bd34b58bd6af513252f8dfc9cb28ab5f20f;hb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;hp=159f59998d96064de4e8942ffbe5f22ac43ddad1;hpb=2504ebe1552b488aa48999535963cc0e6bc3d4ae;p=kivitendo-erp.git diff --git a/SL/DB/Manager/Part.pm b/SL/DB/Manager/Part.pm index 159f59998..0b751bd34 100644 --- a/SL/DB/Manager/Part.pm +++ b/SL/DB/Manager/Part.pm @@ -35,29 +35,28 @@ sub type_filter { # this is to make selection like type => { part => 1, service => 1 } work if ('HASH' eq ref $type) { - $type = grep { $type->{$_} } keys %$type; + $type = [ grep { $type->{$_} } keys %$type ]; } - my @types = listify($type); + my @types = grep { $_ } listify($type); my @filter; for my $type (@types) { if ($type =~ m/^part/) { - push @filter, (and => [ or => [ $prefix . assembly => 0, $prefix . assembly => undef ], - "!${prefix}inventory_accno_id" => 0, - "!${prefix}inventory_accno_id" => undef, + push @filter, (and => [ or => [ $prefix . assembly => 0, $prefix . assembly => undef ], + "!${prefix}inventory_accno_id" => 0, + "!${prefix}inventory_accno_id" => undef, ]); } elsif ($type =~ m/^service/) { push @filter, (and => [ or => [ $prefix . assembly => 0, $prefix . assembly => undef ], - or => [ $prefix . inventory_accno_id => 0, $prefix . inventory_accno_id => undef ], + or => [ $prefix . inventory_accno_id => 0, $prefix . inventory_accno_id => undef ], ]); } elsif ($type =~ m/^assembl/) { push @filter, ($prefix . assembly => 1); } } - return @filter > 2 ? (or => \@filter) : - @filter ? @filter : (); + return @filter > 2 ? (or => \@filter) : @filter; } sub get_ordered_qty {