X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FIS.pm;h=9a197ab84b9114c4c96c8355db8aacc5aa14100d;hb=4b47dbd9756ab4d8df2ee508fb3179c77372629a;hp=98f283711412470e9a5438dc9f1a44fdf7306e62;hpb=358f1ed4ec3370dd9ffc7cb9505e7960fa719205;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 98f283711..9a197ab84 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1697,13 +1697,19 @@ sub retrieve_item { my $where = qq|NOT p.obsolete = '1'|; my @values; - foreach my $column (qw(p.partnumber p.description pgpartsgroup)) { + foreach my $column (qw(p.partnumber p.description pgpartsgroup )) { my ($table, $field) = split m/\./, $column; next if !$form->{"${field}_${i}"}; $where .= qq| AND lower(${column}) ILIKE ?|; push @values, '%' . $form->{"${field}_${i}"} . '%'; } + #Es soll auch nach EAN gesucht werden, ohne Einschränkung durch Beschreibung + if ($form->{"partnumber_$i"} && !$form->{"description_$i"}) { + $where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|; + push @values, $form->{"partnumber_$i"}; + } + if ($form->{"description_$i"}) { $where .= qq| ORDER BY p.description|; } else {