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
16 'country' => $cust_main_county->country,
17 'state' => $cust_main_county->state,
20 $search{'county'} = $cust_main_county->county
21 if $cust_main_county->city;
23 foreach my $delete ( qsearch('cust_main_county', \%search) ) {
24 # unless ( qsearch('cust_main',{
25 # 'state' => $cust_main_county->getfield('state'),
26 # 'county' => $cust_main_county->getfield('county'),
27 # 'country' => $cust_main_county->getfield('country'),
29 my $error = $delete->delete;
32 #should really fix the $cust_main record
37 $cust_main_county->taxnum('');
38 if ( $cust_main_county->city ) {
39 $cust_main_county->city('');
41 $cust_main_county->county('');
43 my $error = $cust_main_county->insert;