X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=00a030117fa7f5eaaa4ded9fbd6740345d179e73;hb=f3717767d19f9da888e190f87a04dfa245d658b4;hp=4d44692b3c88be63a13b7e8875e1a67d9caa3b8d;hpb=52d81f0b1f3bc092da71e7f5919d332c4fa012d5;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 4d44692b3..00a030117 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2377,8 +2377,11 @@ sub search_sql { # parse censustract ### - if ( $params->{'censustract'} =~ /^([.\d]+)$/ and $1 ) { - push @where, "cust_main.censustract = '". $params->{censustract}. "'"; + if ( exists($params->{'censustract'}) ) { + $params->{'censustract'} =~ /^([.\d]*)$/; + my $censustract = "cust_main.censustract = '$1'"; + $censustract .= ' OR cust_main.censustract is NULL' unless $1; + push @where, "( $censustract )"; } ###