X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FReport%2FFCC_477.pm;h=29505f8e9afd2a44f73e58068a3b010d28079795;hp=760f6f22daf5d16e1e03ed6dff969cc09365d7bf;hb=c71e63352e02433369be15591a89765f83cddd0c;hpb=59794290ab64401e73ddc1bf5a5e06e0b41c8b1a diff --git a/FS/FS/Report/FCC_477.pm b/FS/FS/Report/FCC_477.pm index 760f6f22d..29505f8e9 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 ); + my $eh = $class->$check_method( $row, 'date'=>$opt{'date'} ); $num_errors++ if keys(%$eh); push @$error, $eh } @@ -442,12 +442,19 @@ 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{11}$/) { - $e{'censustract_bad'} = 'The census tract must be exactly 11 digits.'; + } elsif ($row->[0] !~ /^\d{$census_digits}$/) { + $e{'censustract_bad'} = "The census tract must be exactly $census_digits digits."; } #technology @@ -515,12 +522,18 @@ 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{11}$/) { - $e{'censustract_bad'} = 'The census tract must be exactly 11 digits.'; + } elsif ($row->[0] !~ /^\d{$census_digits}$/) { + $e{'censustract_bad'} = "The census tract must be exactly $census_digits digits."; } return \%e; }