<DIV STYLE="display: inline-block" ID="<% $field %>_input">
<INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>>
% if (
-% ref $unmask_field
+% $value
+% && ref $unmask_field
% && !$unmask_field->{unmask_ss}
% && $FS::CurrentUser::CurrentUser->access_right( $unmask_field->{access_right} )
% ) {
<TH ALIGN="right"><% $stateid_label %></TH>
<TD>
<INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12 ID="stateid">
-% if ( $FS::CurrentUser::CurrentUser->access_right( 'Unmask customer DL' )) {
+% if ( $stateid && $FS::CurrentUser::CurrentUser->access_right( 'Unmask customer DL' )) {
<& /elements/link-replace_element_text.html, {target_id => 'stateid', replace_text => $cust_main->stateid} &>
% }
</TD>
<% $conf->exists('unmask_ss')
? $cust_main->ss
: $cust_main->masked('ss') || ' ' %>
-% if ( !$conf->exists('unmask_ss') && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')) {
+% if (
+% $cust_main->ss
+% && !$conf->exists('unmask_ss')
+% && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')
+% ) {
<& /elements/link-replace_element_text.html, {
target_id => 'ss_span',
replace_text => $cust_main->ss,
<TD>
<span id="stateid_span" style="white-space:nowrap;">
<% $cust_main->masked('stateid') || ' ' %>
-% if ( $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')) {
+% if (
+% $cust_main->stateid
+% && $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')
+% ) {
<& /elements/link-replace_element_text.html, {
target_id => 'stateid_span',
replace_text => $cust_main->stateid,