From f5fa5936b194d069689856e3854410e22f2b8d90 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 17 Oct 2013 19:27:17 -0700 Subject: advanced package report: search by properties of the location object, #23582 --- FS/FS/cust_pkg.pm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'FS') 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 @@ -4470,6 +4488,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 ### -- cgit v1.2.1