1 <% &ntable("#cccccc") %>
4 <TH ALIGN="right"><%$r%>Contact name<BR>(last, first)</TH>
6 <INPUT TYPE="text" NAME="<%$pre%>last" VALUE="<% $cust_main->get($pre.'last') %>" onChange="<% $onchange %>" <%$disabled%>> ,
7 <INPUT TYPE="text" NAME="<%$pre%>first" VALUE="<% $cust_main->get($pre.'first') %>" onChange="<% $onchange %>" <%$disabled%>>
9 % if ( $conf->exists('show_ss') && !$pre ) {
11 <TD ALIGN="right">SS#</TD>
12 <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $cust_main->ss %>" SIZE=11></TD>
15 <TD><INPUT TYPE="hidden" NAME="ss" VALUE="<% $cust_main->ss %>"></TD>
22 <TD ALIGN="right">Company</TD>
24 <INPUT TYPE="text" NAME="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
29 <TH ALIGN="right"><%$r%>Address</TH>
31 <INPUT TYPE="text" NAME="<%$pre%>address1" VALUE="<% $cust_main->get($pre.'address1') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
36 <TD ALIGN="right"> </TD>
38 <INPUT TYPE="text" NAME="<%$pre%>address2" VALUE="<% $cust_main->get($pre.'address2') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
43 <TH ALIGN="right"><%$r%>City</TH>
45 <INPUT TYPE="text" NAME="<%$pre%>city" VALUE="<% $cust_main->get($pre.'city') %>" onChange="<% $onchange %>" <%$disabled%>>
47 <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
49 <% include('select-county.html', %select_hash ) %>
51 <TH ALIGN="right"><%$r%>State</TH>
53 <% include('select-state.html', %select_hash ) %>
57 <INPUT TYPE="text" NAME="<%$pre%>zip" VALUE="<% $cust_main->get($pre.'zip') %>" SIZE=10 onChange="<% $onchange %>" <%$disabled%>>
62 <TH ALIGN="right"><%$r%>Country</TH>
63 <TD COLSPAN=5><% include('select-country.html', %select_hash ) %></TD>
67 <TD ALIGN="right"><% $daytime_label %></TD>
69 <INPUT TYPE="text" NAME="<%$pre%>daytime" VALUE="<% $cust_main->get($pre.'daytime') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%>>
74 <TD ALIGN="right"><% $night_label %></TD>
76 <INPUT TYPE="text" NAME="<%$pre%>night" VALUE="<% $cust_main->get($pre.'night') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%>>
81 <TD ALIGN="right">Fax</TD>
83 <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%>>
88 <%$r%>required fields<BR>
92 my( $cust_main, $pre, $onchange, $disabled ) = @_;
93 my $conf = new FS::Conf;
95 #false laziness with ship state
96 my $countrydefault = $conf->config('countrydefault') || 'US';
97 $cust_main->set($pre.'country', $countrydefault )
98 unless $cust_main->get($pre.'country');
100 my $statedefault = $conf->config('statedefault')
101 || ($countrydefault eq 'US' ? 'CA' : '');
102 $cust_main->set($pre.'state', $statedefault )
103 unless $cust_main->get($pre.'state')
104 || $cust_main->get($pre.'country') ne $countrydefault;
106 #my($county_html, $state_html, $country_html) =
107 # FS::cust_main_county::regionselector( $cust_main->get($pre.'county'),
108 # $cust_main->get($pre.'state'),
109 # $cust_main->get($pre.'country'),
116 'county' => $cust_main->get($pre.'county'),
117 'state' => $cust_main->get($pre.'state'),
118 'country' => $cust_main->get($pre.'country'),
120 'onchange' => $onchange,
121 'disabled' => $disabled,
124 my @counties = counties( $cust_main->get($pre.'state'),
125 $cust_main->get($pre.'country'),
127 my $county_style = scalar(@counties) > 1 ? '' : 'STYLE="visibility:hidden"';
129 my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
130 my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone';
132 my $r = qq!<font color="#ff0000">*</font> !;