diff options
author | Ivan Kohler <ivan@freeside.biz> | 2022-04-11 15:50:10 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2022-04-11 15:50:10 -0700 |
commit | 32e9b8146661a5bc6b340b09dacc8a70813555f6 (patch) | |
tree | 4a355b850e5cea8c1d5bda4c126a732bda1aede8 /FS/FS | |
parent | d70cb00205062085e5433a34bc0f7068c4e969e2 (diff) |
update adv. package report wrt new census data, RT#86245
Diffstat (limited to 'FS/FS')
-rw-r--r-- | FS/FS/cust_pkg/Search.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/cust_pkg/Search.pm b/FS/FS/cust_pkg/Search.pm index 3e1ca82..c5a7eb9 100644 --- a/FS/FS/cust_pkg/Search.pm +++ b/FS/FS/cust_pkg/Search.pm @@ -402,9 +402,12 @@ sub search { my $op = $params->{location_cust} ? '=' : '!='; push @where, "cust_location.locationnum $op cust_main.ship_locationnum"; } - if ( $params->{location_census} xor $params->{location_nocensus} ) { - my $op = $params->{location_census} ? "IS NOT NULL" : "IS NULL"; - push @where, "cust_location.censustract $op"; + if ( $params->{location_census} ) { + push @where, "cust_location.censustract IS NOT NULL", + "cust_location.censusyear = '2020' "; + } elsif ( $params->{location_nocensus} ) { + push @where, "( cust_location.censustract IS NULL ". + " OR cust_location.censusyear != '2020' )"; } if ( $params->{location_geocode} xor $params->{location_nogeocode} ) { my $op = $params->{location_geocode} ? "IS NOT NULL" : "IS NULL"; |