X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg_taxrate.pm;h=c83f700d9336429910848626726db957787bb5f6;hb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;hp=fb1afce185eec04eaf9f452b527bf3080d75848e;hpb=339c9336a908446c63980bff864bdc270c408e23;p=freeside.git diff --git a/FS/FS/part_pkg_taxrate.pm b/FS/FS/part_pkg_taxrate.pm index fb1afce18..c83f700d9 100644 --- a/FS/FS/part_pkg_taxrate.pm +++ b/FS/FS/part_pkg_taxrate.pm @@ -292,7 +292,9 @@ sub batch_import { time_zone => 'floating', ); my $dt = $parser->parse_datetime( $hash->{'effdate'} ); - $hash->{'effdate'} = $dt ? $dt->epoch : ''; + return "Can't parse effdate ". $hash->{'effdate'}. ': '. $parser->errstr + unless $dt; + $hash->{'effdate'} = $dt->epoch; $hash->{'country'} = 'US'; # CA is available @@ -301,6 +303,13 @@ sub batch_import { if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') { delete($hash->{actionflag}); + foreach my $intfield (qw( taxproductnum taxclassnum effdate )) { + if ( $hash->{$intfield} eq '' ) { + return "$intfield is empty in search! -- ". + join(" ", map { "$_ => *". $hash->{$_}. '*' } keys(%$hash) ); + } + } + my $part_pkg_taxrate = qsearchs('part_pkg_taxrate', $hash); unless ( $part_pkg_taxrate ) { if ( $hash->{taxproductnum} ) { @@ -375,7 +384,7 @@ sub batch_import { } if ( scalar( @columns ) ) { $dbh->rollback if $oldAutoCommit; - return "Unexpected trailing columns in line (wrong format?): $line"; + return "Unexpected trailing columns in line (wrong format?) importing part_pkg_taxrate: $line"; } my $error = &{$hook}(\%part_pkg_taxrate);