From 149053bc35e73874455b9465847d1845e68fa37d Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 27 Feb 2022 16:59:21 -0800 Subject: search for missing/outdated census tract, RT#86245 --- FS/FS/cust_main/Search.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'FS/FS/cust_main') diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 25216c6..37b8ec8 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -790,6 +790,20 @@ sub search { } ## + # no_censustract + ## + if ( $params->{'no_censustract'} ) { + push @where, "EXISTS( + SELECT 1 FROM cust_location + WHERE locationnum = cust_main.ship_locationnum + AND cust_location.country = 'US' + AND ( cust_location.censusyear IS NULL + OR cust_location.censusyear != '2020' + ) + )"; + } + + ## # phones ## -- cgit v1.1