% my @prefixes;
% if ( $old{onlyship} ) {
% @prefixes = ('ship_');
% } elsif ( $old{same} ) {
% @prefixes = ('');
% } else {
% @prefixes = ('', 'ship_');
% }
% for my $pre ('', 'ship_') {
% my $name = $pre eq 'ship_' ? 'service' : 'billing';
% if ( $new{$pre.'addr_clean'} ) {
Entered <%$name%> address |
Standardized <%$name%> address |
% if ( $old{$pre.'company'} ) {
<% $old{$pre.'company'} %> |
<% $new{$pre.'company'} %> |
% }
<% $old{$pre.'address1'} %> |
<% $new{$pre.'address1'} %> |
<% $old{$pre.'address2'} %> |
<% $new{$pre.'address2'} %> |
<% $old{$pre.'city'} %>, <% $old{$pre.'state'} %> <% $old{$pre.'zip'} %> |
<% $new{$pre.'city'} %>, <% $new{$pre.'state'} %> <% $new{$pre.'zip'} %> |
% } # if addr_clean
% elsif ( $new{$pre.'error'} ) {
Entered <%$name%> address |
% if ( $old{$pre.'company'} ) {
<% $old{$pre.'company'} %> |
% }
<% $old{$pre.'address1'} %> |
<% $new{$pre.'error'} %> |
<% $old{$pre.'address2'} %> |
<% $old{$pre.'city'} %>, <% $old{$pre.'state'} %> <% $old{$pre.'zip'} %> |
% } #if error
% } # for $pre
%# only do this part if address standardization provided a censustract
% if ( $new{'ship_censustract'} ) {
Entered census tract |
Calculated census tract |
<% $old{'ship_censustract'} %> |
% if ( $new{'ship_census_error'} ) {
<% $new{'ship_census_error'} %>
% } else {
<% $new{'ship_censustract'} %>
% }
|
% } #if censustract
% if ( $new{error} or $new{ship_error} ) {
|
|
% }
% else {
|
|
|
% } # !error
<%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{onlyship} ? 'address' : 'addresses';
%init>