X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=7c9868d7ae601cdb7e2df4ecea07180f9288526e;hb=c71fd54c5103b16e7f7296ce6cc6750986119bd8;hp=b8d8f102f94970adf646d1a4b7daa3306a1cc25d;hpb=4747bfbea3f4abb66d05a2bd1abed69e28a4aa3d;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b8d8f102f..7c9868d7a 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3033,7 +3033,7 @@ contacts with a matching cust_contact.classnum are returned. When a classnum of 0 is given, contacts with a null classnum are also included. Arguments may also contain the dest flag names 'invoice' or 'message'. -If given, contacts who's invoice_dest and/or invoice_message flags are +If given, contacts who's invoice_dest and/or message_dest flags are not set to 'Y' will be excluded. =cut @@ -3072,14 +3072,15 @@ sub contact_list { # WHERE ... # AND ( - # ( cust_contact.classnum IN (1,2,3) ) - # OR - # ( cust_contact.classnum IS NULL ) - # + # ( + # cust_contact.classnum IN (1,2,3) + # OR + # cust_contact.classnum IS NULL + # ) # AND ( - # ( cust_contact.invoice_dest = 'Y' ) + # cust_contact.invoice_dest = 'Y' # OR - # ( cust_contact.message_dest = 'Y' ) + # cust_contact.message_dest = 'Y' # ) # ) @@ -3105,12 +3106,14 @@ sub contact_list { $search->{extra_sql} .= ' AND ( '; if (@or_classnum) { - $search->{extra_sql} .= join ' OR ', map {" ($_) "} @or_classnum; + $search->{extra_sql} .= ' ( '; + $search->{extra_sql} .= join ' OR ', map {" $_ "} @or_classnum; + $search->{extra_sql} .= ' ) '; $search->{extra_sql} .= ' AND ( ' if @and_dest; } if (@and_dest) { - $search->{extra_sql} .= join ' OR ', map {" ($_) "} @and_dest; + $search->{extra_sql} .= join ' OR ', map {" $_ "} @and_dest; $search->{extra_sql} .= ' ) ' if @or_classnum; }