diff options
author | Mark Wells <mark@freeside.biz> | 2013-10-17 19:27:17 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-10-17 19:27:17 -0700 |
commit | f5fa5936b194d069689856e3854410e22f2b8d90 (patch) | |
tree | 64d3ee4e6b0032851e05138cd49084fa56f4d1ed /FS | |
parent | c5faf08296702144c0b35ca857df1ca3313c37ff (diff) |
advanced package report: search by properties of the location object, #23582
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 ### |