ce5a4f6710775eb3e0ad805441045e5e4d5dc3b6
[freeside.git] / htdocs / edit / process / cust_main_county.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: cust_main_county.cgi,v 1.2 1998-11-18 09:01:41 ivan Exp $
4 #
5 # ivan@sisd.com 97-dec-16
6 #
7 # Changes to allow page to work at a relative position in server
8 #       bmccane@maxbaud.net     98-apr-3
9 #
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
11 #
12 # $Log: cust_main_county.cgi,v $
13 # Revision 1.2  1998-11-18 09:01:41  ivan
14 # i18n! i18n!
15 #
16
17 use strict;
18 use CGI;
19 use CGI::Carp qw(fatalsToBrowser);
20 use FS::UID qw(cgisuidsetup);
21 use FS::CGI qw(eidiot);
22 use FS::Record qw(qsearch qsearchs);
23 use FS::cust_main_county;
24
25 my($req)=new CGI;
26 &cgisuidsetup($cgi);
27
28 foreach ( $cgi->param ) {
29   /^tax(\d+)$/ or die "Illegal form $_!";
30   my($taxnum)=$1;
31   my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
32     or die "Couldn't find taxnum $taxnum!";
33   next unless $old->getfield('tax') ne $cgi->param("tax$taxnum");
34   my(%hash)=$old->hash;
35   $hash{tax}=$cgi->param("tax$taxnum");
36   my($new)=create FS::cust_main_county \%hash;
37   my($error)=$new->replace($old);
38   eidiot($error) if $error;
39 }
40
41 $cgi->redirect(popurl(3). "/browse/cust_main_county.cgi");
42