1 <% $cgi->redirect(popurl(3). "browse/cust_main_county.cgi?".
2 "country=". uri_escape($cgi->param('country')).";".
3 'state='. uri_escape($cgi->param('state')). ';'.
4 'county='. uri_escape($cgi->param('county'))
10 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
12 $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
14 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum } )
15 or die "Unknown taxnum $taxnum";
17 #really should do this in a .pm & start transaction
20 'country' => $cust_main_county->country,
21 'state' => $cust_main_county->state,
24 $search{'county'} = $cust_main_county->county
25 if $cust_main_county->city;
27 foreach my $delete ( qsearch('cust_main_county', \%search) ) {
28 # unless ( qsearch('cust_main',{
29 # 'state' => $cust_main_county->getfield('state'),
30 # 'county' => $cust_main_county->getfield('county'),
31 # 'country' => $cust_main_county->getfield('country'),
33 my $error = $delete->delete;
36 #should really fix the $cust_main record
41 $cust_main_county->taxnum('');
42 if ( $cust_main_county->city ) {
43 $cust_main_county->city('');
44 } elsif ( $cust_main_county->county ) {
45 $cust_main_county->county('');
47 die "can't collapse that";
50 my $error = $cust_main_county->insert;