1 <% $cgi->redirect(popurl(3). "browse/cust_main_county.cgi") %>
5 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
7 my($query) = $cgi->keywords;
8 $query =~ /^(\d+)$/ or die "Illegal taxnum!";
10 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum } )
11 or die "Unknown taxnum $taxnum";
13 #really should do this in a .pm & start transaction
15 foreach my $delete ( qsearch('cust_main_county', {
16 'country' => $cust_main_county->country,
17 'state' => $cust_main_county->state
19 # unless ( qsearch('cust_main',{
20 # 'state' => $cust_main_county->getfield('state'),
21 # 'county' => $cust_main_county->getfield('county'),
22 # 'country' => $cust_main_county->getfield('country'),
24 my $error = $delete->delete;
27 #should really fix the $cust_main record
32 $cust_main_county->taxnum('');
33 $cust_main_county->county('');
34 my $error = $cust_main_county->insert;