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} ) {
}
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);