$html = qq!<A HREF="$url?! . $cust_main->custnum . '">'
if $url;
+ if ( $FS::CurrentUser::CurrentUser->num_agents ) {
+ $html .= encode_entities($cust_main->agent->agent). ' ';
+ }
+
$html .= 'Customer #<B>'. $cust_main->display_custnum.
- ': '. encode_entities($cust_main->name). '</B></A>';
+ '</B>: <B>'. encode_entities($cust_main->name). '</B></A>'.
' - <B><FONT COLOR="#'. $cust_main->statuscolor. '">'.
$cust_main->status_label. '</FONT></B>';
$html .= encode_entities($cust_main->address2). '<BR>'
if $cust_main->address2;
$html .= encode_entities($cust_main->city) . ', ' if $cust_main->city;
- $html .= $cust_main->state. ' '.
- $cust_main->zip. '<BR>';
- $html .= $cust_main->country. '<BR>'
+ $html .= encode_entities($cust_main->state). ' '.
+ encode_entities($cust_main->zip). '<BR>';
+ $html .= encode_entities($cust_main->country). '<BR>'
if $cust_main->country && $cust_main->country ne $countrydefault;
}
$html .= '</TD></TR><TR><TD></TD><TD BGCOLOR="#ffffff">';
- if ( $cust_main->daytime && $cust_main->night ) {
- $html .= ( FS::Msgcat::_gettext('daytime') || 'Day' ).
- ' '. $cust_main->daytime.
- '<BR>'. ( FS::Msgcat::_gettext('night') || 'Night' ).
- ' '. $cust_main->night;
- } elsif ( $cust_main->daytime || $cust_main->night ) {
- $html .= $cust_main->daytime || $cust_main->night;
+
+ my $num_numbers = 0;
+ $num_numbers++ foreach grep $cust_main->$_(), qw( daytime night mobile );
+ if ( $num_numbers > 1 ) {
+ $html .= ucfirst( FS::Msgcat::_gettext('daytime') ).
+ ' '. $cust_main->daytime. '<BR>'
+ if $cust_main->daytime;
+ $html .= ucfirst( FS::Msgcat::_gettext('night') ).
+ ' '. $cust_main->night. '<BR>'
+ if $cust_main->night;
+ $html .= ucfirst( FS::Msgcat::_gettext('mobile') ).
+ ' '. $cust_main->mobile. '<BR>'
+ if $cust_main->night;
+ } elsif ( $num_numbers ) { # == 1 ) {
+ $html .= ( $cust_main->daytime || $cust_main->night || $cust_main->mobile ).
+ '<BR>';
}
if ( $cust_main->fax ) {
- $html .= '<BR>Fax '. $cust_main->fax;
+ $html .= 'Fax '. $cust_main->fax;
}
$html .= '</TD></TR></TABLE></TD>';