1 package FS::part_event::Condition::hasnt_cust_tag;
2 use base qw( FS::part_event::Condition );
5 #use FS::Record qw( qsearch );
8 'Customer does not have (any selected) tag',
11 sub eventtable_hashref {
20 'tagnum' => { 'label' => 'Customer tag',
21 'type' => 'select-cust_tag',
28 my( $self, $object ) = @_;
30 my $cust_main = $self->cust_main($object);
32 my $hashref = $self->option('tagnum') || {};
33 ! grep $hashref->{ $_->tagnum }, $cust_main->cust_tag;
38 my( $self, $table ) = @_;
41 "SELECT tagnum FROM cust_tag WHERE cust_tag.custnum = $table.custnum".
42 " AND cust_tag.tagnum IN ".
43 $self->condition_sql_option_option_integer('tagnum');
45 "NOT EXISTS($matching_tags)";