diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_pkg.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index b2cb8f02b..682b11b90 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -4239,6 +4239,24 @@ boolean; if true, returns only packages with more than 0 FCC phone lines. Limit to packages with a service location in the specified state and country. For FCC 477 reporting, mostly. +=item location_cust + +Limit to packages whose service location is the same as the customer's +default service location. + +=item location_nocust + +Limit to packages whose service location is not the customer's default +service location. + +=item location_census + +Limit to packages whose service location has a census tract. + +=item location_nocensus + +Limit to packages whose service location doesn't have a census tract. + =back =cut @@ -4471,6 +4489,18 @@ sub search { } ### + # location_* flags + ### + if ( $params->{location_cust} xor $params->{location_nocust} ) { + 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"; + } + + ### # parse part_pkg ### |