X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fconfirm-address_standardize.html;h=0a05c70bd99cbc60fbc056db068c122cde98d6e3;hb=3a02a1bce4190ce0d94883709e0a6c362bcb0af3;hp=57201ea5ac5692becae176fc99a3c83580e050a9;hpb=2bb7db96a07599e980323c1b6b23a8c79cc17a9a;p=freeside.git diff --git a/httemplate/misc/confirm-address_standardize.html b/httemplate/misc/confirm-address_standardize.html index 57201ea5a..0a05c70bd 100644 --- a/httemplate/misc/confirm-address_standardize.html +++ b/httemplate/misc/confirm-address_standardize.html @@ -1,8 +1,15 @@

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

+
-% my @prefixes; -% if ( $old{onlyship} ) { -% @prefixes = ('ship_'); -% } elsif ( $old{same} ) { -% @prefixes = ('bill_'); -% } else { -% @prefixes = ('bill_', 'ship_'); -% } % for my $pre (@prefixes) { -% my $name = $pre eq 'ship_' ? 'service' : 'billing'; -% if ( $new{$pre.'addr_clean'} ) { +% 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 % my $pre = $old{same} ? 'bill_' : 'ship_'; % my $censustract = $new{$pre.'censustract'}; -% my $census_error = $new{$pre.'census_error'}; % if ( $censustract ) { + + @@ -90,36 +114,21 @@ Confirm address standardization % } #if censustract -% if ( $new{bill_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{$pre.'censustract'} %>
-
- -
- -
-% } # !error +
<%init> # slightly weird interface... @@ -128,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;