'contribution_soft_credit_contact_id',
'contribution_soft_credit_amount',
'contribution_soft_credit_type',
- 'contribution_participant_id',
);
/**
// type of selector
$this->_action = $action;
$returnProperties = CRM_Contribute_BAO_Query::selectorReturnProperties();
- $returnProperties['contribution_participant_id'] = 1;
$this->_includeSoftCredits = CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled($this->_queryParams);
$this->_query = new CRM_Contact_BAO_Query(
$this->_queryParams,
$contributionStatuses
);
+ $isPayLater = FALSE;
if ($result->is_pay_later && CRM_Utils_Array::value('contribution_status_name', $row) == 'Pending') {
+ $isPayLater = TRUE;
$row['contribution_status'] .= ' (' . ts('Pay Later') . ')';
$links[CRM_Core_Action::ADD] = array(
'name' => ts('Pay with Credit Card'),
'id' => $result->contribution_id,
'cid' => $result->contact_id,
'cxt' => $this->_context,
- 'pid' => $result->contribution_participant_id,
+ 'compId' => $result->contribution_id,
+ 'comp' => 'contribution',
);
- if (!empty($row['contribution_participant_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'),
- );
- }
+ if ($row['contribution_status_name'] == 'Partially paid' || $isPayLater) {
+ $links[CRM_Core_Action::ADD] = array(
+ 'name' => ts('Record Payment'),
+ 'url' => 'civicrm/payment',
+ 'qs' => 'reset=1&id=%%compId%%&cid=%%cid%%&action=add&component=%%comp%%',
+ '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(