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)
source => {
filter => {
(part_type => $self->part_type) x!!$self->part_type,
+ or => [ obsolete => undef, obsolete => 0 ],
'all:substr:multi::ilike' => $::form->{term},
},
},
sub query_autocomplete {
my ($self) = @_;
+ my $cv_query = <<SQL;
+ SELECT id FROM customer
+ WHERE (obsolete IS NULL)
+ OR (obsolete = FALSE)
+
+ UNION
+
+ SELECT id FROM vendor
+ WHERE (obsolete IS NULL)
+ OR (obsolete = FALSE)
+SQL
+
my $result = SL::DB::Manager::Contact->get_all(
query => [
or => [
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',
source => {
filter => {
'all:substr:multi::ilike' => $::form->{term}, # all filter spec is set in SL::DB::Manager::Customer
+ or => [ obsolete => undef, obsolete => 0 ],
},
},
sorted => {