summaryrefslogtreecommitdiff
path: root/FS/bin
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2022-04-11 15:46:05 -0700
committerIvan Kohler <ivan@freeside.biz>2022-04-11 15:46:05 -0700
commitb2326b23cf72af64884e5e33c7b2ae586adce0bf (patch)
tree90e719a0cc5a2242abc8499c98b41985a86ebdaa /FS/bin
parent470ee3041d636af555bf59eedf8f0943e20ca9da (diff)
re-try locations with missing censustract, RT#86245
Diffstat (limited to 'FS/bin')
-rwxr-xr-xFS/bin/freeside-censustract-update15
1 files changed, 10 insertions, 5 deletions
diff --git a/FS/bin/freeside-censustract-update b/FS/bin/freeside-censustract-update
index 27a17be36..49505ee81 100755
--- a/FS/bin/freeside-censustract-update
+++ b/FS/bin/freeside-censustract-update
@@ -35,9 +35,14 @@ my %h_cust_location = map { $_->locationnum => $_ }
# Find all locations that don't have censusyear = the current
# year as of now.
-my @cust_location = qsearch( 'cust_location',
- { censusyear => { op => '!=', value => $current_year } },
-);
+my @cust_location = qsearch({
+ 'table' => 'cust_location',
+ 'hashref' => { 'country' => 'US', },
+ 'extra_sql' => " AND ( censusyear != '$current_year'
+ OR censustract IS NULL
+ )
+ ",
+});
warn scalar(@cust_location)." records found.\n";
my $queued = 0; my $updated = 0;
@@ -84,8 +89,8 @@ freeside-censustract-update - Update census tract codes to the current year.
=head1 DESCRIPTION
Finds all customers whose census tract codes don't appear to be current
-and updates them to the current year. The "current year" is defined by
-the I<census_tract> configuration variable, not the calendar year.
+and updates them to the current year. The "current year" is 2020, unless the
+I<census_legacy> configuration variable is set.
The -d option tells the script to assume that tract codes last modified
after some date are already current. Those customers will just have