summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-11-13 15:32:31 -0800
committerMark Wells <mark@freeside.biz>2012-11-13 15:32:31 -0800
commit2bb7db96a07599e980323c1b6b23a8c79cc17a9a (patch)
treeb9261d163d64c4c7a73648a4081442e4b739a9ff /httemplate/misc
parente32344effc97e76f9ee26fbf4ee206bfaee47a54 (diff)
address standardization/census tract fixes
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/confirm-address_standardize.html23
-rw-r--r--httemplate/misc/confirm-censustract.html5
-rw-r--r--httemplate/misc/xmlhttp-address_standardize.html4
3 files changed, 18 insertions, 14 deletions
diff --git a/httemplate/misc/confirm-address_standardize.html b/httemplate/misc/confirm-address_standardize.html
index a6f4b06e8..57201ea5a 100644
--- a/httemplate/misc/confirm-address_standardize.html
+++ b/httemplate/misc/confirm-address_standardize.html
@@ -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 {
@@ -15,11 +15,11 @@ Confirm address standardization
% if ( $old{onlyship} ) {
% @prefixes = ('ship_');
% } elsif ( $old{same} ) {
-% @prefixes = ('');
+% @prefixes = ('bill_');
% } else {
-% @prefixes = ('', 'ship_');
+% @prefixes = ('bill_', 'ship_');
% }
-% for my $pre ('', 'ship_') {
+% for my $pre (@prefixes) {
% my $name = $pre eq 'ship_' ? 'service' : 'billing';
% if ( $new{$pre.'addr_clean'} ) {
<TR>
@@ -70,24 +70,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();">
diff --git a/httemplate/misc/confirm-censustract.html b/httemplate/misc/confirm-censustract.html
index ae0ae3a6a..6a11617e7 100644
--- a/httemplate/misc/confirm-censustract.html
+++ b/httemplate/misc/confirm-censustract.html
@@ -61,12 +61,13 @@ warn $cgi->param('q') if $DEBUG;
my $q = decode_json($cgi->param('q'))
or die "bad argument '".$cgi->param('q')."'";
+my $pre = $q->{'same'} ? 'bill_' : 'ship_';
my %location = (
- map { $_ => $q->{'ship_'.$_} }
+ map { $_ => $q->{$pre.$_} }
qw( company address1 address2 city state zip country latitude longitude )
);
-my $old_tract = $q->{'ship_censustract'};
+my $old_tract = $q->{$pre.'censustract'};
my $cache = eval { FS::GeocodeCache->new(%location) };
$cache->set_censustract;
my $year = FS::Conf->new->config('census_year');
diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html
index e28c06f3a..1620642cb 100644
--- a/httemplate/misc/xmlhttp-address_standardize.html
+++ b/httemplate/misc/xmlhttp-address_standardize.html
@@ -20,9 +20,9 @@ my @prefixes;
if ($old{onlyship}) {
@prefixes = ('ship_');
} elsif ( $old{same} ) {
- @prefixes = ('');
+ @prefixes = ('bill_');
} else {
- @prefixes = ('', 'ship_');
+ @prefixes = ('bill_', 'ship_');
}
foreach my $pre ( @prefixes ) {