'contribution_soft_credit_contact_id',
'contribution_soft_credit_amount',
'contribution_soft_credit_type',
+ 'participant_contribution_id',
);
/**
// type of selector
$this->_action = $action;
-
+ $returnProperties = CRM_Contribute_BAO_Query::selectorReturnProperties();
+ $returnProperties['participant_contribution_id'] = 1;
$this->_includeSoftCredits = CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled($this->_queryParams);
$this->_query = new CRM_Contact_BAO_Query(
$this->_queryParams,
- CRM_Contribute_BAO_Query::selectorReturnProperties(),
+ $returnProperties,
NULL, FALSE, FALSE,
CRM_Contact_BAO_Query::MODE_CONTRIBUTE
);
'id' => $result->contribution_id,
'cid' => $result->contact_id,
'cxt' => $this->_context,
+ 'pid' => $result->participant_id,
);
+ if (!empty($row['participant_contribution_id'])) {
+ if ($row['contribution_status_name'] == 'Partially paid') {
+ $links[CRM_Core_Action::ADD] = array(
+ 'name' => ts('Record Payment'),
+ 'url' => 'civicrm/payment',
+ 'qs' => 'reset=1&id=%%pid%%&cid=%%cid%%&action=add&component=event',
+ 'title' => ts('Record Payment'),
+ );
+ }
+
+ if ($row['contribution_status_name'] == 'Pending refund') {
+ $links[CRM_Core_Action::ADD] = array(
+ 'name' => ts('Record Refund'),
+ 'url' => 'civicrm/payment',
+ 'qs' => 'reset=1&id=%%pid%%&cid=%%cid%%&action=add&component=event',
+ 'title' => ts('Record Refund'),
+ );
+ }
+ }
$row['action'] = CRM_Core_Action::formLink(
$links,
$query->_element['participant_fee_amount'] = 1;
}
+ if (!empty($query->_returnProperties['participant_contribution_id'])) {
+ $query->_select['participant_contribution_id'] = "civicrm_participant_payment.participant_id as participant_contribution_id";
+ $query->_element['participant_contribution_id'] = 1;
+ $query->_tables['civicrm_contribution_participant_payment'] = 1;
+ $query->_whereTables['civicrm_contribution_participant_payment'] = 1;
+ }
+
//add fee currency
if (!empty($query->_returnProperties['participant_fee_currency'])) {
$query->_select['participant_fee_currency'] = "civicrm_participant.fee_currency as participant_fee_currency";
$from = " LEFT JOIN civicrm_participant ON civicrm_participant.contact_id = contact_a.id ";
break;
+ case 'civicrm_contribution_participant_payment':
+ $from = " $side JOIN civicrm_participant_payment ON civicrm_contribution.id = civicrm_participant_payment.contribution_id ";
+ break;
+
case 'civicrm_event':
//CRM-17121
$from = " LEFT JOIN civicrm_event ON civicrm_participant.event_id = civicrm_event.id ";