- my $t = qsearchs( 'tax_rate_location',
- { map { $_ => $self->$_ } qw( data_vendor geocode ) },
- );
-
- return "geocode already in use for this vendor"
+ my $t;
+ $t = qsearchs( 'tax_rate_location',
+ { disabled => '',
+ ( map { $_ => $self->$_ } qw( data_vendor geocode ) ),
+ },
+ )
+ unless $self->disabled;
+
+ $t = $self->by_key( $self->taxratelocationnum )
+ if ( !$t && $self->taxratelocationnum );
+
+ return "geocode ". $self->geocode. " already in use for this vendor"