X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg_taxrate.pm;h=e29c3d0b47c524705358d85ea90525dbcad4e192;hb=7f5e32275a5a2674fd1d220cd651b222b9831476;hp=5a1e7baa990c297745b3ad2e0e9af61f3f7e845e;hpb=f6dd863ff944a162b2f135e820c7932b2615e332;p=freeside.git diff --git a/FS/FS/part_pkg_taxrate.pm b/FS/FS/part_pkg_taxrate.pm index 5a1e7baa9..e29c3d0b4 100644 --- a/FS/FS/part_pkg_taxrate.pm +++ b/FS/FS/part_pkg_taxrate.pm @@ -292,15 +292,24 @@ 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 - delete($hash->{'taxable'}) if ($hash->{'taxable'} eq 'N'); + $hash->{'taxable'} = '' if ($hash->{'taxable'} eq 'N'); 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} ) {