1 <!-- $Id: cust_main_county-collapse.cgi,v 1.2 2002-01-30 14:18:09 ivan Exp $ -->
4 my($query) = $cgi->keywords;
5 $query =~ /^(\d+)$/ or die "Illegal taxnum!";
7 my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
8 or die ("Unknown taxnum!");
10 #really should do this in a .pm & start transaction
12 foreach my $delete ( qsearch('cust_main_county', {
13 'country' => $cust_main_county->country,
14 'state' => $cust_main_county->state
16 # unless ( qsearch('cust_main',{
17 # 'state' => $cust_main_county->getfield('state'),
18 # 'county' => $cust_main_county->getfield('county'),
19 # 'country' => $cust_main_county->getfield('country'),
21 my $error = $delete->delete;
24 #should really fix the $cust_main record
29 $cust_main_county->taxnum('');
30 $cust_main_county->county('');
31 my $error = $cust_main_county->insert;
34 print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");