$payinfo = '';
$cgi->param('tagnum', FS::part_tag->default_tags);
- $cust_main->coord_auto('Y');
- $cust_main->ship_coord_auto('Y');
if ( $cgi->param('qualnum') =~ /^(\d+)$/ ) {
my $qualnum = $1;
my $countrydefault = $conf->config('countrydefault') || 'US';
my $statedefault = $conf->config('statedefault') || 'CA';
$cust_main->set('bill_location',
- FS::cust_location->new(
- { country => $countrydefault, state => $statedefault }
- )
+ FS::cust_location->new( {
+ country => $countrydefault,
+ state => $statedefault,
+ coord_auto => 'Y',
+ } )
);
$cust_main->set('ship_location',
- FS::cust_location->new(
- { country => $countrydefault, state => $statedefault }
- )
+ FS::cust_location->new( {
+ country => $countrydefault,
+ state => $statedefault,
+ coord_auto => 'Y',
+ } )
);
}
//alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
}
-% # the value in 'censustract' is the confirmed censustract; if it's set,
+% # the value in 'ship_censustract' is the confirmed censustract; if it's set,
% # do nothing here
function confirm_censustract() {
var cf = document.CustomerForm;
- if ( cf.elements['censustract'].value == '' ) {
+ if ( cf.elements['ship_censustract'].value == '' ) {
var address_info = form_address_info();
address_info['ship_latitude'] = cf.elements['ship_latitude'].value;
address_info['ship_longitude'] = cf.elements['ship_longitude'].value;
%# called from confirm-censustract.html
function set_censustract(tract, year) {
var cf = document.CustomerForm;
- cf.elements['censustract'].value = tract;
- cf.elements['censusyear'].value = year;
+ cf.elements['ship_censustract'].value = tract;
+ cf.elements['ship_censusyear'].value = year;
submit_continue();
}
'ship_state': ship_state_el.options[ ship_state_el.selectedIndex ].value,
'ship_zip': cf.elements['<% $ship_prefix %>zip'].value,
'ship_country': cf.elements['<% $ship_prefix %>country'].value,
+% if ( !$onlyship ) {
+ 'same': cf.elements['same'].checked
+% }
};
}
address_standardize(JSON.stringify(address_info), confirm_standardize);
}
else {
- cf.elements['ship_addr_clean'].value = 'Y';
+ cf.elements['<% $ship_prefix %>addr_clean'].value = 'Y';
% if ( !$onlyship ) {
- cf.elements['addr_clean'].value = 'Y';
+ cf.elements['<% $main_prefix %>addr_clean'].value = 'Y';
% }
post_standardization();
}
% if ( $withcensus ) {
var cf = document.<% $formname %>;
cf.elements['<% $main_prefix %>censustract'].value =
- cf.elements['<% $main_prefix %>enter_censustract'].value;
+ cf.elements['enter_censustract'].value;
% }
post_standardization();
}
</B><BR><BR>
<TABLE WIDTH="100%">
+% my @prefixes;
+% if ( $old{onlyship} ) {
+% @prefixes = ('ship_');
+% } elsif ( $old{same} ) {
+% @prefixes = ('');
+% } else {
+% @prefixes = ('', 'ship_');
+% }
% for my $pre ('', 'ship_') {
-% next if !$pre and $old{onlyship};
% my $name = $pre eq 'ship_' ? 'service' : 'billing';
% if ( $new{$pre.'addr_clean'} ) {
<TR>
my %new;
-foreach my $pre ( '', 'ship_' ) {
- next unless ($pre || !$old{onlyship});
+my @prefixes;
+if ($old{onlyship}) {
+ @prefixes = ('ship_');
+} elsif ( $old{same} ) {
+ @prefixes = ('');
+} else {
+ @prefixes = ('', 'ship_');
+}
+foreach my $pre ( @prefixes ) {
my $location = {
map { $_ => $old{$pre.$_} }