From af0fda98b23ec71c5cc11221ccac1c73a964737b Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 20 Jan 2016 16:11:03 +0530 Subject: [PATCH] CRM-16259, get particiant id if contribution is related to event ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- CRM/Contribute/BAO/Contribution.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 432585681b..102bf1fce4 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3652,6 +3652,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $getInfoOf['id'] = $contributionId; $defaults = array(); $contributionDAO = CRM_Contribute_BAO_Contribution::retrieve($getInfoOf, $defaults, CRM_Core_DAO::$_nullArray); + if (!$participantId) { + $participantId = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $contributionId, 'participant_id'); + } if ($paymentType == 'owed') { // build params for recording financial trxn entry -- 2.25.1