Form 477 update for 2022+ reporting (2020 census data), RT#86245 (New FS::Misc::Geo...
[freeside.git] / FS / bin / freeside-censustract-update
old mode 100644 (file)
new mode 100755 (executable)
index af9ad74..27a17be
@@ -18,14 +18,14 @@ $FS::UID::AutoCommit = 0;
 my $dbh = dbh;
 
 my $conf = FS::Conf->new;
-my $current_year = $conf->config('census_year') 
-  or die "No current census year configured.\n";
+my $current_year = $conf->config('census_legacy') || '2020';
 my $date = str2time($opt{d}) if $opt{d};
 $date ||= time;
 # This now operates on cust_location, not cust_main.
 # Find all locations that, as of $date, did not have 
 # censusyear = the current year.  This includes those 
 # that have no censusyear.
+local($FS::Record::qsearch_qualify_columns) = 0;
 my %h_cust_location = map { $_->locationnum => $_ }
   qsearch(
     'h_cust_location',