1 <% &ntable("#cccccc") %>
4 <TH ALIGN="right"><%$r%><% mt('Contact name (last, first)') |h %></TH>
6 <INPUT TYPE="text" NAME="<%$pre%>last" VALUE="<% $cust_main->get($pre.'last') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>> ,
7 <INPUT TYPE="text" NAME="<%$pre%>first" VALUE="<% $cust_main->get($pre.'first') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>>
9 % if ( $conf->exists('show_ss') && !$pre ) {
11 <TD ALIGN="right"><% mt('SS#') |h %></TD>
12 <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $opt{ss} %>" SIZE=11></TD>
15 <TD><INPUT TYPE="hidden" NAME="ss" VALUE="<% $opt{ss} %>"></TD>
21 % if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
23 <TD ALIGN="right" WIDTH="200">
24 <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es)
26 <TD bgcolor="#FFFF00">
27 <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
33 <TD ALIGN="right"><% mt('Company') |h %></TD>
35 <INPUT TYPE="text" NAME="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
39 <& /elements/location.html,
41 'object' => $cust_main,
42 'onchange' => $onchange,
43 'disabled' => $disabled,
45 'same_checked' => $opt{'same_checked'},
46 'geocode' => $opt{'geocode'},
47 'censustract' => $opt{'censustract'},
51 <TD ALIGN="right"><% $daytime_label %></TD>
53 <INPUT TYPE="text" NAME="<%$pre%>daytime" VALUE="<% $cust_main->get($pre.'daytime') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
58 <TD ALIGN="right"><% $night_label %></TD>
60 <INPUT TYPE="text" NAME="<%$pre%>night" VALUE="<% $cust_main->get($pre.'night') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
65 <TD ALIGN="right"><% mt('Fax') |h %></TD>
67 <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
71 % if ( $conf->exists('show_stateid') && !$pre ) {
74 <TD ALIGN="right"><% $stateid_label %></TD>
75 <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $opt{stateid} %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>></TD>
76 <TD ALIGN="right"><% $stateid_state_label %></TD>
77 <TD><& /elements/select-state.html,
78 'state' => $cust_main->stateid_state,
79 'country' => $cust_main->country,
80 'prefix' => 'stateid_',
81 'onchange' => $onchange,
82 'disabled' => $disabled,
89 <TD><INPUT TYPE="hidden" NAME="stateid" VALUE="<% $opt{stateid} %>"></TD>
90 <TD><INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>"></TD>
94 <%$r%><% mt('required fields') |h %><BR>
99 my $cust_main = $opt{'cust_main'};
100 my $pre = $opt{'pre'};
101 my $onchange = $opt{'onchange'};
102 my $disabled = $opt{'disabled'};
103 my @style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
105 my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
107 my $conf = new FS::Conf;
109 foreach (qw(ss stateid)) {
110 $opt{$_} = $cust_main->masked($_) unless exists $opt{$_};
113 #false laziness with ship state
114 my $countrydefault = $conf->config('countrydefault') || 'US';
115 $cust_main->set($pre.'country', $countrydefault )
116 unless $cust_main->get($pre.'country');
118 my $statedefault = $conf->config('statedefault')
119 || ($countrydefault eq 'US' ? 'CA' : '');
120 $cust_main->set($pre.'state', $statedefault )
121 unless $cust_main->get($pre.'state')
122 || $cust_main->get($pre.'country') ne $countrydefault;
124 $cust_main->set('stateid_state', $cust_main->state )
125 unless $pre || $cust_main->get('stateid_state');
127 $opt{geocode} ||= $cust_main->get('geocode');
129 if ( $conf->exists('cust_main-require_censustract') ) {
130 $opt{censustract} ||= $cust_main->censustract;
133 my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
135 : FS::Msgcat::_gettext('daytime');
136 my $night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/
138 : FS::Msgcat::_gettext('night') || 'Night Phone';
139 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
140 ? 'Driver’s License'
141 : FS::Msgcat::_gettext('stateid') || 'Driver’s License';
142 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
143 ? 'Driver’s License State'
144 : FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State';
146 my $r = qq!<font color="#ff0000">*</font> !;
148 my @invoicing_list = $cust_main->invoicing_list;