Choose tax location

<% $header %>



<%init> my $conf = new FS::Conf; my $have_selected = 0; my ($data_vendor) = $cgi->param('data_vendor') =~ /^([-\w]+)$/; my ($city) = $cgi->param('city') =~ /^([\w ]+)$/; my ($state) = $cgi->param('state') =~ /^(\w+)$/; my ($zip) = $cgi->param('zip') =~ /^([-\w]+)$/; my($zip5, $zip4) = split('-', $zip); my $hashref = { data_vendor => $data_vendor, #city => $city, #state => $state, zip => $zip5, }; #my @keys = qw ( city state zip ); my @keys = qw ( zip ); my @cust_tax_location = (); until ( @cust_tax_location ) { @cust_tax_location = qsearch({ table => 'cust_tax_location', hashref => $hashref, order_by => 'LIMIT 50', }); last unless scalar(@keys); delete $hashref->{ shift @keys }; } my %max = ( city => 4, county => 6, state => 5); foreach my $location (@cust_tax_location) { foreach ( qw( city county state ) ) { my $length = length($location->$_); $max{$_} = ($length > $max{$_}) ? $length : $max{$_}; } } $max{$_}++ foreach qw( city county state ); my $header = '  '; $header .= $_. ' ' x ( $max{lc($_)} - length($_) ) foreach qw( City County State ); $header .= "In city?"; my $style = "font-family:monospace;";