% if ( $is_error ) { Address standardization error % } % else { Confirm address standardization % }

% for my $pre (@prefixes) { % my $name = $pre eq 'bill_' ? 'billing' : 'service'; % my $rows = 5; % if ( $new{$pre.'error'} ) { % if ( $old{$pre.'company'} ) { % } % } else { # not an error % $rows++ if !$new{$pre.'addr_clean'}; % if ( !$new{$pre.'addr_clean'} ) { % } % if ( $old{$pre.'company'} ) { % } % } # if error % } # for $pre %# only do this part if address standardization provided a censustract % my $pre = $old{same} ? 'bill_' : 'ship_'; % my $censustract = $new{$pre.'censustract'}; % if ( $censustract ) { % } #if censustract
CLASS="td_radio"> Entered <%$name%> address
<% $old{$pre.'company'} |h %>
<% $old{$pre.'address1'} |h %> <% $new{$pre.'error'} %>
<% $old{$pre.'address2'} |h %>
<% $old{$pre.'city'} |h %>, <% $old{$pre.'state'} |h %> <% $old{$pre.'zip'} |h %>
CLASS="td_radio"> Entered <%$name%> address Standardized <%$name%> address CLASS="td_radio">
(unverified)
<% $old{$pre.'company'} |h %> <% $new{$pre.'company'} |h %>
<% $old{$pre.'address1'} |h %> <% $new{$pre.'address1'} |h %>
<% $old{$pre.'address2'} |h %> <% $new{$pre.'address2'} |h %>
<% $old{$pre.'city'} |h %>, <% $old{$pre.'state'} |h %> <% $old{$pre.'zip'} |h %> <% $new{$pre.'city'} |h %>, <% $new{$pre.'state'} |h %> <% $new{$pre.'zip'} |h %>
> Entered census tract Calculated census tract >
<% $old{$pre.'censustract'} %> % if ( $census_error ) { <% $census_error %> % } else { <% $censustract %> % }
<%init> # slightly weird interface... my $q = decode_json($cgi->param('q')); #warn Dumper($q); my %old = %{ $q->{old} }; my %new = %{ $q->{new} }; my $addresses = $old{billship} ? 'addresses' : 'address'; my @prefixes = (''); if ( $old{same} ) { @prefixes = ('bill_'); } elsif ( $old{billship} ) { @prefixes = ('bill_', 'ship_'); } my $census_error = $new{'census_error'}; my $is_error = $census_error || grep { $new{$_.'error'} } @prefixes;