% 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'] ) {
% # 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'];
cf.elements['ship_censustract'].value =
address_info['ship_censustract'];
}
+% } else {
+ cf.elements['censustract'].value =
+ address_info['censustract'];
+% }
}
% if ( $conf->config('address_standardize_method') ) {
%# 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;
cf.elements['ship_censustract'].value =
cf.elements['enter_censustract'].value;
}
+% } else {
+ cf.elements['censustract'].value = cf.elements['enter_censustract'].value;
+% }
% }
post_standardization();
}
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_';