From 4b47dbd9756ab4d8df2ee508fb3179c77372629a Mon Sep 17 00:00:00 2001 From: Holger Lindemann Date: Fri, 24 Apr 2009 12:46:37 +0000 Subject: [PATCH] =?utf8?q?Suche=20auch=20nach=20EAN=20auf=20Gleichheit,=20?= =?utf8?q?wenn=20nur=20partnumber=20gef=C3=BCllt=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IS.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 { -- 2.20.1