+ #create temp tables
+ $error ||= _create_temporary_tables( $job, $format );
+
+ #import new data
+ unless ($error) {
+ eval { &{$continuation}( $job, $param ) };
+ $error = $@ if $@;
+ }
+
+ #restore taxproducts
+ $error ||= _restore_remembered_tax_products( $job, $format, \%taxproduct );
+
+ #disable tax_rates
+ $error ||=
+ _restore_remembered_disabled_taxes( $job, $format, \%disabled_tax_rate );
+
+ #wipe out the old data
+ $error ||= _remove_old_tax_data( $job, $format );
+
+ #untemporize
+ $error ||= _copy_from_temp( $job, $format );
+
+ } elsif ( $format =~ /^billsoft-(\w+)/ ) {
+
+ my $mode = $1;
+ my @sql;
+ if ( $mode eq 'pcode' ) {
+ push @sql,
+ "DELETE FROM cust_tax_location WHERE data_vendor = 'billsoft'",
+ "UPDATE tax_rate_location SET disabled = 'Y' WHERE data_vendor = 'billsoft'";
+ } elsif ( $mode eq 'taxclass' ) {
+ push @sql,
+ "DELETE FROM tax_class WHERE data_vendor = 'billsoft'";
+ } elsif ( $mode eq 'taxproduct' ) {
+ push @sql,
+ "DELETE FROM part_pkg_taxproduct WHERE data_vendor = 'billsoft'";
+ }