5 <% include('/elements/header.html','Import successful') %>
6 <% include('/elements/footer.html') %>
11 unless $FS::CurrentUser::CurrentUser->access_right('Import');
13 my $cfh = $cgi->upload('codefile');
14 my $zfh = $cgi->upload('plus4file');
15 my $tfh = $cgi->upload('txmatrix');
16 my $dfh = $cgi->upload('detail');
20 my $oldAutoCommit = $FS::UID::AutoCommit;
21 local $FS::UID::AutoCommit = 0;
24 my $error = defined($cfh)
25 ? FS::tax_class::batch_import( {
27 'format' => scalar($cgi->param('format')),
31 $error ||= defined($zfh)
32 ? FS::cust_tax_location::batch_import( {
34 'format' => scalar($cgi->param('format')),
38 $error ||= defined($tfh)
39 ? FS::part_pkg_taxrate::batch_import( {
41 'format' => scalar($cgi->param('format')),
43 : 'No tax matrix file';
45 $error ||= defined($dfh)
46 ? FS::tax_rate::batch_import( {
48 'format' => scalar($cgi->param('format')),
50 : 'No tax detail file';
53 $dbh->rollback or die $dbh->errstr if $oldAutoCommit;
55 $dbh->commit or die $dbh->errstr if $oldAutoCommit;