From 4cdfbd752ecf4b5d134da8643c62c213b86c69dc Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 28 Aug 2017 13:36:48 +0200 Subject: [PATCH] =?utf8?q?Quicksuche:=20bei=20Stammdatensuche=20keine=20un?= =?utf8?q?g=C3=BCltigen=20anbieten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Betrifft: • Artikelstammdaten in allen Varianten (Waren, Dienstleistungen, Erzeugnisse, Sortimente) • Kunden & Lieferanten • Ansprechpersonen (hier werden nur diejenigen angeboten, die zu gültigen Kunden/Lieferanten gehören) --- SL/Controller/TopQuickSearch/Article.pm | 1 + SL/Controller/TopQuickSearch/Contact.pm | 14 +++++++++++++- SL/Controller/TopQuickSearch/CustomerVendor.pm | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SL/Controller/TopQuickSearch/Article.pm b/SL/Controller/TopQuickSearch/Article.pm index ba051d280..e689bbe81 100644 --- a/SL/Controller/TopQuickSearch/Article.pm +++ b/SL/Controller/TopQuickSearch/Article.pm @@ -83,6 +83,7 @@ sub init_models { source => { filter => { (part_type => $self->part_type) x!!$self->part_type, + or => [ obsolete => undef, obsolete => 0 ], 'all:substr:multi::ilike' => $::form->{term}, }, }, diff --git a/SL/Controller/TopQuickSearch/Contact.pm b/SL/Controller/TopQuickSearch/Contact.pm index e170524ab..322df3763 100644 --- a/SL/Controller/TopQuickSearch/Contact.pm +++ b/SL/Controller/TopQuickSearch/Contact.pm @@ -19,6 +19,18 @@ sub description_field { t8('Contacts') } sub query_autocomplete { my ($self) = @_; + my $cv_query = <get_all( query => [ or => [ @@ -26,7 +38,7 @@ sub query_autocomplete { cp_givenname => { ilike => like($::form->{term}) }, cp_email => { ilike => like($::form->{term}) }, ], - cp_cv_id => [ \'SELECT id FROM customer UNION SELECT id FROM vendor' ], + cp_cv_id => [ \$cv_query ], ], limit => 10, sort_by => 'cp_name', diff --git a/SL/Controller/TopQuickSearch/CustomerVendor.pm b/SL/Controller/TopQuickSearch/CustomerVendor.pm index f337d10a1..0f18b3b1a 100644 --- a/SL/Controller/TopQuickSearch/CustomerVendor.pm +++ b/SL/Controller/TopQuickSearch/CustomerVendor.pm @@ -82,6 +82,7 @@ sub init_models { source => { filter => { 'all:substr:multi::ilike' => $::form->{term}, # all filter spec is set in SL::DB::Manager::Customer + or => [ obsolete => undef, obsolete => 0 ], }, }, sorted => { -- 2.20.1