1 <TABLE CLASS="fsinnerbox">
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>
19 % if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
21 <TD ALIGN="right" WIDTH="200">
22 <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum)
23 ? $r : '' %>Email address(es)
25 <TD bgcolor="#FFFF00">
26 <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
31 % unless ( $conf->exists('cust-edit-alt-field-order') ) { #standard order
38 % } else { #alternate field order
47 % if ( $conf->exists('show_stateid') && !$pre ) {
50 <TD ALIGN="right"><% $stateid_label %></TD>
51 <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $opt{stateid} %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>></TD>
52 <TD ALIGN="right"><% $stateid_state_label %></TD>
53 <TD><& /elements/select-state.html,
54 'state' => $cust_main->stateid_state,
55 'country' => $cust_main->country,
56 'prefix' => 'stateid_',
57 'onchange' => $onchange,
58 'disabled' => $disabled,
65 <TD><INPUT TYPE="hidden" NAME="stateid" VALUE="<% $opt{stateid} %>"></TD>
66 <TD><INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>"></TD>
70 <%$r%><% mt('required fields') |h %><BR>
73 % my $display = ($cust_main->residential_commercial eq 'Commercial')
75 <TR ID="<%$pre%>company_row" STYLE="display:<%$display%>">
76 <TD ALIGN="right"><% mt('Company') |h %></TD>
78 <INPUT TYPE="text" NAME="<%$pre%>company" ID="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=60 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
84 <& /elements/location.html,
86 'object' => $cust_main,
87 'onchange' => $onchange,
88 'disabled' => $disabled,
90 'same_checked' => $opt{'same_checked'},
91 'geocode' => $opt{'geocode'},
92 'censustract' => $opt{'censustract'},
98 <TD ALIGN="right" VALIGN="top"><% mt('Phones') %></TD>
101 <TABLE CELLSPACING=0 CELLPADDING=0>
104 <INPUT TYPE="text" NAME="<%$pre%>daytime" VALUE="<% $cust_main->get($pre.'daytime') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
105 <BR><FONT SIZE=-1><% $daytime_label %></FONT>
109 <INPUT TYPE="text" NAME="<%$pre%>night" VALUE="<% $cust_main->get($pre.'night') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
110 <BR><FONT SIZE=-1><% $night_label %></FONT>
114 <INPUT TYPE="text" NAME="<%$pre%>mobile" VALUE="<% $cust_main->get($pre.'mobile') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
115 <BR><FONT SIZE=-1><% $mobile_label %></FONT>
125 <TD ALIGN="right"><% mt('Fax') |h %></TD>
127 <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
134 my $r = qq!<font color="#ff0000">*</font> !;
139 my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style,
140 $daytime_label, $night_label, $mobile_label,
147 $cust_main = $opt{'cust_main'};
149 $onchange = $opt{'onchange'};
150 $disabled = $opt{'disabled'};
151 @style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
153 $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
155 my $conf = new FS::Conf;
157 foreach (qw(ss stateid)) {
158 $opt{$_} = $cust_main->masked($_) unless exists $opt{$_};
161 #false laziness with ship state
162 my $countrydefault = $conf->config('countrydefault') || 'US';
163 $cust_main->set($pre.'country', $countrydefault )
164 unless $cust_main->get($pre.'country');
166 my $statedefault = $conf->config('statedefault')
167 || ($countrydefault eq 'US' ? 'CA' : '');
168 $cust_main->set($pre.'state', $statedefault )
169 unless $cust_main->get($pre.'state')
170 || $cust_main->get($pre.'country') ne $countrydefault;
172 $cust_main->set('stateid_state', $cust_main->state )
173 unless $pre || $cust_main->get('stateid_state');
175 $opt{geocode} ||= $cust_main->get('geocode');
177 $opt{censustract} ||= $cust_main->censustract;
179 $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
181 : FS::Msgcat::_gettext('daytime');
182 $night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/
184 : FS::Msgcat::_gettext('night') || 'Night';
185 $mobile_label = FS::Msgcat::_gettext('mobile') =~/^(mobile)?$/
187 : FS::Msgcat::_gettext('mobile') || 'Mobile';
189 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
190 ? 'Driver’s License'
191 : FS::Msgcat::_gettext('stateid') || 'Driver’s License';
192 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
193 ? 'Driver’s License State'
194 : FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State';
196 my @invoicing_list = $cust_main->invoicing_list;
198 my $agentnum = $cust_main->agentnum if $cust_main->custnum;