Merge branch 'patch-19' of https://github.com/gjones2/Freeside
[freeside.git] / httemplate / misc / confirm-address_standardize.html
index a6f4b06..420e8ea 100644 (file)
@@ -2,7 +2,7 @@
 th { line-height: 150% }
 </STYLE>
 <CENTER><BR><B>
-% if ( $new{error} or $new{ship_error} ) {
+% if ( $new{bill_error} or $new{ship_error} ) {
 Address standardization error
 % }
 % else {
@@ -11,16 +11,14 @@ Confirm address standardization
 
 </B><BR><BR>
 <TABLE WIDTH="100%">
-% my @prefixes;
-% if ( $old{onlyship} ) {
-%   @prefixes = ('ship_');
-% } elsif ( $old{same} ) {
-%   @prefixes = ('');
-% } else {
-%   @prefixes = ('', 'ship_');
+% my @prefixes = ('');
+% if ( $old{same} ) {
+%   @prefixes = ('bill_');
+% } elsif ( $old{billship} ) {
+%   @prefixes = ('bill_', 'ship_');
 % }
-% for my $pre ('', 'ship_') {
-%   my $name = $pre eq 'ship_' ? 'service' : 'billing';
+% for my $pre (@prefixes) {
+%   my $name = $pre eq 'bill_' ? 'billing' : 'service';
 %   if ( $new{$pre.'addr_clean'} ) {
   <TR>
     <TH>Entered <%$name%> address</TH>
@@ -70,24 +68,27 @@ Confirm address standardization
 % } # 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'};
+% my $census_error = $new{$pre.'census_error'};
+% if ( $censustract ) {
   <TR>
     <TH>Entered census tract</TH>
     <TH>Calculated census tract</TH>
   </TR>
   <TR>
-    <TD><% $old{'ship_censustract'} %></TD>
+    <TD><% $old{$pre.'censustract'} %></TD>
     <TD>
-%     if ( $new{'ship_census_error'} ) {
-      <FONT COLOR="#ff0000"><% $new{'ship_census_error'} %></FONT>
+%     if ( $census_error ) {
+      <FONT COLOR="#ff0000"><% $census_error %></FONT>
 %     } else {
-      <% $new{'ship_censustract'} %>
+      <% $censustract %>
 %     }
     </TD>
   </TR>
 % } #if censustract
 
-% if ( $new{error} or $new{ship_error} ) {
+% if ( $new{bill_error} or $new{ship_error} ) {
   <TR>
     <TD ALIGN="center">
     <BUTTON TYPE="button" STYLE="width:205px" onclick="confirm_manual_address();">
@@ -125,6 +126,6 @@ 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';
 
 </%init>