X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_tax_location.pm;h=161a6547b14d5b24ad95fe82265ba63237bb249f;hp=7c6989c652df185f5a2565f4541962a4e860624c;hb=aed8ec35ccb9cdeb7ea0cb6ff2946f9d83d582f6;hpb=c46d0f3d030f71a21a6d459100b29d7454f8627b diff --git a/FS/FS/cust_tax_location.pm b/FS/FS/cust_tax_location.pm index 7c6989c65..161a6547b 100644 --- a/FS/FS/cust_tax_location.pm +++ b/FS/FS/cust_tax_location.pm @@ -125,19 +125,25 @@ sub check { ; return $error if $error; - #ugh! cch canada weirdness - if ($self->state eq 'CN') { + #ugh! cch canada weirdness and more + if ($self->state eq 'CN' && $self->data_vendor eq 'cch-zip' ) { $error = "Illegal cch canadian zip" unless $self->zip =~ /^[A-Z]$/; + } elsif ($self->state =~ /^E([B-DFGILNPR-UW])$/ && $self->data_vendor eq 'cch-zip' ) { + $error = "Illegal cch european zip" + unless $self->zip =~ /^E$1$/; } else { $error = $self->ut_number('zip', $self->state eq 'CN' ? 'CA' : 'US'); } return $error if $error; - #ugh! cch canada weirdness + #ugh! cch canada weirdness and more return "must specify either city/county or plus4lo/plus4hi" unless ( $self->plus4lo && $self->plus4hi || - ($self->city || $self->state eq 'CN') && $self->county + ( $self->city || + $self->state eq 'CN' || + $self->state =~ /^E([B-DFGILNPR-UW])$/ + ) && $self->county ); $self->SUPER::check; @@ -277,7 +283,7 @@ sub batch_import { if ( $job ) { # progress bar if ( time - $min_sec > $last ) { my $error = $job->update_statustext( - int( 100 * $imported / $count ) + int( 100 * $imported / $count ). ",Importing locations" ); die $error if $error; $last = time;