summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-10-17 19:27:10 -0700
committerMark Wells <mark@freeside.biz>2013-10-17 19:27:10 -0700
commitc99a171b22bf8776a4ba449aed55e20904c881fa (patch)
tree65864b16fdf08297d0d4db78878f2981502d4180 /FS
parentd32ed470ba0869a4005c0c577b98246c48f8be7d (diff)
advanced package report: search by properties of the location object, #23582
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_pkg.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index be5ec6a95..009c81e06 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -4283,6 +4283,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
@@ -4515,6 +4533,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
###