3 %foreach ( grep { /^tax\d+$/ } $cgi->param ) {
4 % /^tax(\d+)$/ or die "Illegal form $_!";
6 % my $old = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
7 % or die "Couldn't find taxnum $taxnum!";
8 % next unless $old->tax != $cgi->param("tax$taxnum")
9 % || $old->exempt_amount != $cgi->param("exempt_amount$taxnum")
10 % || $old->taxname ne $cgi->param("taxname$taxnum")
11 % || $old->setuptax ne $cgi->param("setuptax$taxnum")
12 % || $old->recurtax ne $cgi->param("recurtax$taxnum");
13 % my %hash = $old->hash;
14 % $hash{tax} = $cgi->param("tax$taxnum");
15 % $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum");
16 % $hash{taxname} = $cgi->param("taxname$taxnum");
17 % $hash{setuptax} = $cgi->param("setuptax$taxnum");
18 % $hash{recurtax} = $cgi->param("recurtax$taxnum");
19 % my $new = new FS::cust_main_county \%hash;
20 % my $error = $new->replace($old);
22 % $cgi->param('error', $error);
23 % print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
28 %print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");