X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FSearch.pm;h=58bdd8835bd6dede0b3f1d68c5ef32cb24a8c35a;hp=1a19ea34343e33eb580560650aa0188490b2b0fa;hb=8120b9af43dac87f1a41ac3c8434465517235a25;hpb=917d2f19d6c4403e685810cc5354640c561aa0b7 diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 1a19ea343..58bdd8835 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -1049,8 +1049,9 @@ sub search { if ( @tagnums ) { if ( $params->{'all_tags'} ) { + my $exists = $params->{'all_tags'} eq 'all' ? 'exists' : 'not exists'; foreach ( @tagnums ) { - push @where, 'exists(select 1 from cust_tag where '. + push @where, $exists.'(select 1 from cust_tag where '. 'cust_tag.custnum = cust_main.custnum and tagnum = '. $_ . ')'; }