This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / httemplate / edit / process / cust_main_county.cgi
1 <%
2
3 foreach ( grep { /^tax\d+$/ } $cgi->param ) {
4   /^tax(\d+)$/ or die "Illegal form $_!";
5   my $taxnum = $1;
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   my %hash = $old->hash;
12   $hash{tax} = $cgi->param("tax$taxnum");
13   $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum");
14   $hash{taxname} = $cgi->param("taxname$taxnum");
15   my $new = new FS::cust_main_county \%hash;
16   my $error = $new->replace($old);
17   if ( $error ) {
18     $cgi->param('error', $error);
19     print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
20     myexit();
21   }
22 }
23
24 print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
25
26 %>