diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-19 15:29:55 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-19 15:29:55 -0700 |
commit | a6dd5bc6ba6c655b1707a016db4e97e269b718e5 (patch) | |
tree | a25c54ef8ae298779547a698ca23878cd4bb4870 /httemplate/elements/standardize_locations.js | |
parent | 66906f54d1099dcae84e69240c3a16bc9a82c37f (diff) | |
parent | b75f93f4842bcbb89fc220dba0291ede4d8af300 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/standardize_locations.js')
-rw-r--r-- | httemplate/elements/standardize_locations.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index e98039d9d..d7c36701e 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -11,13 +11,13 @@ function form_address_info() { % if ( $billship ) { returnobj['same'] = cf.elements['same'].checked; % } -% if ( $withfirm ) { -% # not part of either address, really - returnobj['company'] = cf.elements['company'].value; -% } % if ( $withcensus ) { % # "entered" censustract always goes with the ship_ address if there is one - returnobj['ship_censustract'] = cf.elements['enter_censustract'].value; +% if ( $billship ) { + returnobj['ship_censustract'] = cf.elements['enter_censustract'].value; +% } else { # there's only a package address, so it's just "censustract" + returnobj['censustract'] = cf.elements['enter_censustract'].value; +% } % } % for my $pre (@prefixes) { if ( <% $pre eq 'ship_' ? 1 : 0 %> && returnobj['same'] ) { @@ -78,6 +78,7 @@ function standardize_locations() { % # censustract so that we don't ask the user to confirm it again. if ( !changed && <% $withcensus %> ) { +% if ( $billship ) { if ( address_info['same'] ) { cf.elements['bill_censustract'].value = address_info['bill_censustract']; @@ -85,6 +86,10 @@ function standardize_locations() { cf.elements['ship_censustract'].value = address_info['ship_censustract']; } +% } else { + cf.elements['censustract'].value = + address_info['censustract']; +% } } % if ( $conf->config('address_standardize_method') ) { @@ -176,6 +181,7 @@ function confirm_manual_address() { %# not much to do in this case, just confirm the censustract % if ( $withcensus ) { var cf = document.<% $formname %>; +% if ( $billship ) { if ( cf.elements['same'] && cf.elements['same'].checked ) { cf.elements['bill_censustract'].value = cf.elements['enter_censustract'].value; @@ -183,6 +189,9 @@ function confirm_manual_address() { cf.elements['ship_censustract'].value = cf.elements['enter_censustract'].value; } +% } else { + cf.elements['censustract'].value = cf.elements['enter_censustract'].value; +% } % } post_standardization(); } @@ -277,12 +286,13 @@ function setselect(el, value) { my %opt = @_; my $conf = new FS::Conf; -my $withfirm = $opt{'with_firm'} ? 1 : 0; my $withcensus = $opt{'with_census'} ? 1 : 0; my @prefixes = ''; my $billship = $opt{'billship'} ? 1 : 0; # whether to have bill_ and ship_ prefixes my $taxpre = ''; +# probably should just geocode both addresses, since either one could +# be a package address in the future if ($billship) { @prefixes = qw(bill_ ship_); $taxpre = $conf->exists('tax-ship_address') ? 'ship_' : 'bill_'; |