2 % $cgi->param('error', $error);
3 <% $cgi->redirect(popurl(2). "tax_class.html?". $cgi->query_string ) %>
5 <% $cgi->redirect(popurl(3). "browse/tax_rate.cgi?taxclassnum=". uri_escape($tax_class->taxclassnum) ) %>
10 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
12 my $tax_class = new FS::tax_class {
13 'taxclass' => scalar($cgi->param('taxclass')),
14 'description' => scalar($cgi->param('description')),
17 #maybe this whole thing should be in a transaction. at some point, no biggie
18 #none of the follow-up stuff will fail unless there's a more serious problem
19 #than a hanging record in tax_class...
21 my $error = $tax_class->insert;
23 # all of this is highly dubious at the moment
26 # #auto-add the new taxclass to any regions that have taxclasses already
28 # my $sth = dbh->prepare("
29 # SELECT geocode FROM tax_rate
30 # WHERE taxclass IS NOT NULL AND taxclass != ''
32 # ") or die dbh->errstr;
33 # $sth->execute or die $sth->errstr;
35 # while ( my $row = $sth->fetchrow_hashref ) {
36 # warn "inserting for $row";
37 # my $cust_main_county = new FS::tax_rate {
38 # 'geocode' => $row->{geocode},
40 # 'taxclassnum' => $tax_class->taxclassnum,
42 # $error = $cust_main_county->insert;
44 # die $error if $error;