- print "\n", <<END;
- <SCRIPT>
- function changed(what) {
- what.form.same.checked = false;
- }
- function samechanged(what) {
- if ( what.checked ) {
-END
-print " what.form.ship_$_.value = what.form.$_.value;\n"
- for (qw( last first company address1 address2 city zip daytime night fax ));
-print <<END;
- what.form.ship_state.selectedIndex = what.form.state.selectedIndex;
- }
- }
- </SCRIPT>
-END
-
- print '<BR>Service address ',
- '(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)"';
- unless ( $cust_main->ship_last ) {
- print ' CHECKED';
- foreach (
- qw( last first company address1 address2 city state zip daytime night fax)
- ) {
- $cust_main->set("ship_$_", $cust_main->get($_) );
- }
- }
- print '>same as billing address)<BR>';
-
- my($ship_last,$ship_first,$ship_company,$ship_address1,$ship_address2,$ship_city,$ship_zip)=(
- $cust_main->ship_last,
- $cust_main->ship_first,
- $cust_main->ship_company,
- $cust_main->ship_address1,
- $cust_main->ship_address2,
- $cust_main->ship_city,
- $cust_main->ship_zip,
- );
-
- print &itable("#cccccc"), <<END;
- <TR><TH ALIGN="right">${r}Contact name<BR>(last, first)</TH><TD COLSPAN=5>
-END
-
- print <<END;
- <INPUT TYPE="text" NAME="ship_last" VALUE="$ship_last" onChange="changed(this)"> ,
- <INPUT TYPE="text" NAME="ship_first" VALUE="$ship_first" onChange="changed(this)">
-END
-
- print <<END;
- </TD></TR>
- <TR><TD ALIGN="right">Company</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_company" VALUE="$ship_company" SIZE=70 onChange="changed(this)"></TD></TR>
- <TR><TH ALIGN="right">${r}Address</TH><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_address1" VALUE="$ship_address1" SIZE=70 onChange="changed(this)"></TD></TR>
- <TR><TD ALIGN="right"> </TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_address2" VALUE="$ship_address2" SIZE=70 onChange="changed(this)"></TD></TR>
- <TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="ship_city" VALUE="$ship_city" onChange="changed(this)"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="ship_state" SIZE="1" onChange="changed(this)">
-END
-
- $cust_main->ship_country( $conf->config('countrydefault') || 'US' )
- unless $cust_main->ship_country;
- $cust_main->ship_state( $conf->config('statedefault') || 'CA' )
- unless $cust_main->ship_state || $cust_main->ship_country ne 'US';
- foreach ( qsearch('cust_main_county',{}) ) {
- print "<OPTION";
- print " SELECTED" if ( $cust_main->ship_state eq $_->state
- && $cust_main->ship_county eq $_->county
- && $cust_main->ship_country eq $_->country
- );
- print ">",$_->state;
- print " (",$_->county,")" if $_->county;
- print " / ", $_->country;
- }
- print qq!</SELECT></TD><TH>${r}Zip</TH><TD><INPUT TYPE="text" NAME="ship_zip" VALUE="$ship_zip" SIZE=10 onChange="changed(this)"></TD></TR>!;