$html .= encode_entities($cust_main->address1). '<BR>';
$html .= encode_entities($cust_main->address2). '<BR>'
if $cust_main->address2;
- $html .= encode_entities($cust_main->city). ', '. $cust_main->state. ' '.
- $cust_main->zip. '<BR>';
- $html .= $cust_main->country. '<BR>'
+ $html .= encode_entities($cust_main->city) . ', ' if $cust_main->city;
+ $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">';
$cust_main->ship_company,
$ship->address1,
$ship->address2,
- ($ship->city . ', ' . $ship->state . ' ' . $ship->zip),
+ (($ship->city ? $ship->city . ', ' : '') . $ship->state . ' ' . $ship->zip),
($ship->country eq $countrydefault ? '' : $ship->country ),
);