From 2b221bad902f164e29d01488df67271578543c00 Mon Sep 17 00:00:00 2001 From: Tim Mallezie Date: Tue, 1 Sep 2015 12:59:27 +0200 Subject: [PATCH] crm-17125 add contact billing address when no contribution address --- CRM/Contribute/BAO/Contribution.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 6eaca457d1..c0f05bcf98 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2554,6 +2554,13 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $addressDetails = array_values($addressDetails); $values['address'] = $addressDetails[0]['display']; } + // Else we assign the billing address of the contribution contact. + else { + $addressParams = array('contact_id' => $this->contact_id, 'is_billing' => 1); + $addressDetails = CRM_Core_BAO_Address::getValues($addressParams); + $addressDetails = array_values($addressDetails); + $values['address'] = $addressDetails[0]['display']; + } if ($this->_component == 'contribute') { //get soft contributions $softContributions = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id, TRUE); -- 2.25.1