- $billingLocationTypeId = CRM_Core_BAO_LocationType::getBilling();
- }
- else {
- // presence of related contact implies onbehalf of org case,
- // where location type is set to default.
- $locType = CRM_Core_BAO_LocationType::getDefault();
- $billingLocationTypeId = $locType->id;
- }
-
- if (!array_key_exists('related_contact', $values)) {
- list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID, FALSE, $billingLocationTypeId);
+ list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID, FALSE, CRM_Core_BAO_LocationType::getBilling());