X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fconfirm-address_standardize.html;h=0a05c70bd99cbc60fbc056db068c122cde98d6e3;hb=992573160bf2fc89b1d957973109e03d2abf0a47;hp=3603b95d9d5513dcd0336fd789015d87b1bfc065;hpb=468c9e660eb0edb2033f0f8dbb4458f20280082c;p=freeside.git diff --git a/httemplate/misc/confirm-address_standardize.html b/httemplate/misc/confirm-address_standardize.html index 3603b95d9..0a05c70bd 100644 --- a/httemplate/misc/confirm-address_standardize.html +++ b/httemplate/misc/confirm-address_standardize.html @@ -1,8 +1,15 @@

-% if ( $new{error} or $new{ship_error} ) { +% if ( $is_error ) { Address standardization error % } % else { @@ -10,106 +17,118 @@ Confirm address standardization % }

+
-% for my $pre ('', 'ship_') { -% next if !$pre and $old{onlyship}; -% my $name = $pre eq 'ship_' ? 'service' : 'billing'; -% if ( $new{$pre.'addr_clean'} ) { +% for my $pre (@prefixes) { +% my $name = $pre eq 'bill_' ? 'billing' : 'service'; +% my $rows = 5; +% if ( $new{$pre.'error'} ) { - - + + + + % if ( $old{$pre.'company'} ) { - - - % } + - + - - - -% } # if addr_clean -% elsif ( $new{$pre.'error'} ) { +% } else { # not an error +% $rows++ if !$new{$pre.'addr_clean'}; + + + +% if ( !$new{$pre.'addr_clean'} ) { + + + + +% } + % if ( $old{$pre.'company'} ) { + % } - + + + -% } #if error + +% } # if error % } # for $pre %# only do this part if address standardization provided a censustract -% if ( $new{'ship_censustract'} ) { +% my $pre = $old{same} ? 'bill_' : 'ship_'; +% my $censustract = $new{$pre.'censustract'}; +% if ( $censustract ) { + + - + % } #if censustract -% if ( $new{error} or $new{ship_error} ) { + + -% } -% else { - - - - -
Entered <%$name%> addressStandardized <%$name%> address CLASS="td_radio"> + + Entered <%$name%> address +
<% $old{$pre.'company'} %><% $new{$pre.'company'} %>
<% $old{$pre.'address1'} %><% $new{$pre.'address1'} %><% $new{$pre.'error'} %>
<% $old{$pre.'address2'} %><% $new{$pre.'address2'} %>
<% $old{$pre.'city'} %>, <% $old{$pre.'state'} %> <% $old{$pre.'zip'} %><% $new{$pre.'city'} %>, <% $new{$pre.'state'} %> <% $new{$pre.'zip'} %>
CLASS="td_radio"> + + Entered <%$name%> addressStandardized <%$name%> address CLASS="td_radio"> + +
(unverified)
<% $old{$pre.'company'} %><% $new{$pre.'company'} %>
<% $old{$pre.'address1'} %><% $new{$pre.'error'} %><% $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'} %>
+ > + Entered census tract Calculated census tract + > +
<% $old{'ship_censustract'} %><% $old{$pre.'censustract'} %> -% if ( $new{'ship_census_error'} ) { - <% $new{'ship_census_error'} %> +% if ( $census_error ) { + <% $census_error %> % } else { - <% $new{'ship_censustract'} %> + <% $censustract %> % }
-
- -
- -
-% } # !error +
<%init> # slightly weird interface... @@ -118,6 +137,16 @@ my $q = decode_json($cgi->param('q')); my %old = %{ $q->{old} }; my %new = %{ $q->{new} }; -my $addresses = $old{onlyship} ? 'address' : 'addresses'; +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;