diff options
author | jeff <jeff> | 2009-04-23 20:31:26 +0000 |
---|---|---|
committer | jeff <jeff> | 2009-04-23 20:31:26 +0000 |
commit | ec71691725b6c5211b6967323cbc56a03038385d (patch) | |
tree | 4cd8ae8f7b976e9ef27889847fc424baa95ff26e /FS/FS/cust_tax_location.pm | |
parent | 6fd4495cfb983901c1f7cb7ff15410048bda05d7 (diff) |
autodownload and update of cch tax data
Diffstat (limited to 'FS/FS/cust_tax_location.pm')
-rw-r--r-- | FS/FS/cust_tax_location.pm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/FS/FS/cust_tax_location.pm b/FS/FS/cust_tax_location.pm index 7c6989c..161a654 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; |