[freeside-commits] branch FREESIDE_3_BRANCH updated. fa7b2d94bff0db0059d989d64430cd1b59a93b55

Ivan Kohler ivan at freeside.biz
Thu Mar 3 18:42:10 PST 2022


The branch, FREESIDE_3_BRANCH has been updated
       via  fa7b2d94bff0db0059d989d64430cd1b59a93b55 (commit)
       via  2a32e71ba4df776097e02d4d5ede35b214d206e6 (commit)
      from  8613cd33f3985674611525c5f0c96c39f3d77328 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fa7b2d94bff0db0059d989d64430cd1b59a93b55
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Mar 3 18:42:09 2022 -0800

    477 reporting

diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm
index 760f6f22d..0f5d4cedc 100644
--- a/FS/FS/Report/FCC_477.pm
+++ b/FS/FS/Report/FCC_477.pm
@@ -398,7 +398,7 @@ sub fbs_sql {
   my $agentnum = $opt{agentnum};
   my $q = $opt{ignore_quantity} ? '1' : 'COALESCE(cust_pkg.quantity, 1)';
 
-  my $censustract = "replace(cust_location.censustract, '.', '')";
+  my $censustract = "substr( replace(cust_location.censustract, '.', ''), 1, 11)";
 
   my @select = (
     "$censustract AS censustract",
@@ -473,7 +473,7 @@ sub fvs_sql {
   my $date = $opt{date} || time;
   my $agentnum = $opt{agentnum};
   my $q = $opt{ignore_quantity} ? '1' : 'COALESCE(cust_pkg.quantity, 1)';
-  my $censustract = "replace(cust_location.censustract, '.', '')";
+  my $censustract = "substr( replace(cust_location.censustract, '.', ''), 1, 11)";
 
   my @select = (
     "$censustract AS censustract",

commit 2a32e71ba4df776097e02d4d5ede35b214d206e6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Mar 3 18:36:21 2022 -0800

    Revert "update warnings re: census tract length so real errors are easier to spot, RT#86245"
    
    This reverts commit 8998e26614828e2a498781e9c8912e412c856857.

diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm
index 29505f8e9..760f6f22d 100644
--- a/FS/FS/Report/FCC_477.pm
+++ b/FS/FS/Report/FCC_477.pm
@@ -320,7 +320,7 @@ sub report {
   my $num_errors = 0;
   foreach my $row (@$data) {
     if ( $class->can($check_method) ) { # they don't all have these
-      my $eh = $class->$check_method( $row, 'date'=>$opt{'date'} );
+      my $eh = $class->$check_method( $row );
       $num_errors++ if keys(%$eh);
       push @$error, $eh
     }
@@ -442,19 +442,12 @@ sub fbs_sql {
 sub fbs_check {
   my $class = shift;
   my $row = shift;
-
-  my %opt = @_;
-  my $date = $opt{date} || time;
-  my $census_digits = ($date < 1601449200) ? 11 : 15; # 9/30/2020, halfway
-                                                      # between the two filing
-                                                      # dates when it changed
-
   my %e;
   #censustract
   if ( length($row->[0]) == 0 ) {
     $e{'censustract_null'} = 'The package location has no census tract.';
-  } elsif ($row->[0] !~ /^\d{$census_digits}$/) {
-    $e{'censustract_bad'} = "The census tract must be exactly $census_digits digits.";
+  } elsif ($row->[0] !~ /^\d{11}$/) {
+    $e{'censustract_bad'} = 'The census tract must be exactly 11 digits.';
   }
 
   #technology
@@ -522,18 +515,12 @@ sub fvs_sql {
 sub fvs_check {
   my $class = shift;
   my $row = shift;
-  my %opt = @_;
-  my $date = $opt{date} || time;
-  my $census_digits = ($date < 1601449200) ? 11 : 15; # 9/30/2020, halfway
-                                                      # between the two filing
-                                                      # dates when it changed
-
   my %e;
   #censustract
   if ( length($row->[0]) == 0 ) {
     $e{'censustract_null'} = 'The package location has no census tract.';
-  } elsif ($row->[0] !~ /^\d{$census_digits}$/) {
-    $e{'censustract_bad'} = "The census tract must be exactly $census_digits digits.";
+  } elsif ($row->[0] !~ /^\d{11}$/) {
+    $e{'censustract_bad'} = 'The census tract must be exactly 11 digits.';
   }
   return \%e;
 }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Report/FCC_477.pm | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)




More information about the freeside-commits mailing list