projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
schema and module should agree on column names
[freeside.git]
/
FS
/
FS
/
cust_tax_location.pm
diff --git
a/FS/FS/cust_tax_location.pm
b/FS/FS/cust_tax_location.pm
index
7a6af34
..
7c6989c
100644
(file)
--- a/
FS/FS/cust_tax_location.pm
+++ b/
FS/FS/cust_tax_location.pm
@@
-119,7
+119,7
@@
sub check {
|| $self->ut_text('state')
|| $self->ut_numbern('plus4hi')
|| $self->ut_numbern('plus4lo')
|| $self->ut_text('state')
|| $self->ut_numbern('plus4hi')
|| $self->ut_numbern('plus4lo')
- || $self->ut_enum('default
', [ '', ' ', 'Y' ] ) # wtf?
+ || $self->ut_enum('default
_location', [ '', 'Y' ] )
|| $self->ut_enum('cityflag', [ '', 'I', 'O', 'B' ] )
|| $self->ut_alpha('geocode')
;
|| $self->ut_enum('cityflag', [ '', 'I', 'O', 'B' ] )
|| $self->ut_alpha('geocode')
;
@@
-179,7
+179,7
@@
sub batch_import {
}
if ( $format eq 'cch' || $format eq 'cch-update' ) {
}
if ( $format eq 'cch' || $format eq 'cch-update' ) {
- @fields = qw( zip state plus4lo plus4hi geocode default );
+ @fields = qw( zip state plus4lo plus4hi geocode default
_location
);
push @fields, 'actionflag' if $format eq 'cch-update';
$imported++ if $format eq 'cch-update'; #empty file ok
push @fields, 'actionflag' if $format eq 'cch-update';
$imported++ if $format eq 'cch-update'; #empty file ok
@@
-188,6
+188,7
@@
sub batch_import {
my $hash = shift;
$hash->{'data_vendor'} = 'cch';
my $hash = shift;
$hash->{'data_vendor'} = 'cch';
+ $hash->{'default_location'} =~ s/ //g;
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
@@
-210,7
+211,7
@@
sub batch_import {
};
} elsif ( $format eq 'cch-zip' || $format eq 'cch-update-zip' ) {
};
} elsif ( $format eq 'cch-zip' || $format eq 'cch-update-zip' ) {
- @fields = qw( zip city county state postalcity countyfips countydef default geocode cityflag unique );
+ @fields = qw( zip city county state postalcity countyfips countydef default
_location
geocode cityflag unique );
push @fields, 'actionflag' if $format eq 'cch-update-zip';
$imported++ if $format eq 'cch-update'; #empty file ok
push @fields, 'actionflag' if $format eq 'cch-update-zip';
$imported++ if $format eq 'cch-update'; #empty file ok
@@
-222,6
+223,7
@@
sub batch_import {
delete($hash->{$_}) foreach qw( countyfips countydef unique );
$hash->{'cityflag'} =~ s/ //g;
delete($hash->{$_}) foreach qw( countyfips countydef unique );
$hash->{'cityflag'} =~ s/ //g;
+ $hash->{'default_location'} =~ s/ //g;
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
@@
-314,7
+316,7
@@
sub batch_import {
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
- return "Empty file!" unless
$imported
;
+ return "Empty file!" unless
( $imported || $format =~ /^cch-update/ )
;
''; #no error
''; #no error