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'},
97 <& /elements/tr-cust_main-phones.html,
99 'cust_main' => $cust_main,
100 'onchange' => $onchange,
101 'disabled' => $disabled,
108 <TD ALIGN="right"><% mt('Fax') |h %></TD>
110 <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
117 my $r = qq!<font color="#ff0000">*</font> !;
122 my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style );
128 $cust_main = $opt{'cust_main'};
130 $onchange = $opt{'onchange'};
131 $disabled = $opt{'disabled'};
132 @style = ( $opt{'style'} ? @{ $opt{'style'} } : () );
134 $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
136 my $conf = new FS::Conf;
138 foreach (qw(ss stateid)) {
139 $opt{$_} = $cust_main->masked($_) unless exists $opt{$_};
142 #false laziness with ship state
143 my $countrydefault = $conf->config('countrydefault') || 'US';
144 $cust_main->set($pre.'country', $countrydefault )
145 unless $cust_main->get($pre.'country');
147 my $statedefault = $conf->config('statedefault')
148 || ($countrydefault eq 'US' ? 'CA' : '');
149 $cust_main->set($pre.'state', $statedefault )
150 unless $cust_main->get($pre.'state')
151 || $cust_main->get($pre.'country') ne $countrydefault;
153 $cust_main->set('stateid_state', $cust_main->state )
154 unless $pre || $cust_main->get('stateid_state');
156 $opt{geocode} ||= $cust_main->get('geocode');
158 $opt{censustract} ||= $cust_main->censustract;
160 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
161 ? 'Driver’s License'
162 : FS::Msgcat::_gettext('stateid') || 'Driver’s License';
163 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
164 ? 'Driver’s License State'
165 : FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State';
167 my @invoicing_list = $cust_main->invoicing_list;
169 my $agentnum = $cust_main->agentnum if $cust_main->custnum;