Skip to content

Commit

Permalink
CRM-20281 Added credit card type field to soft credit report
Browse files Browse the repository at this point in the history
----------------------------------------
* CRM-19997: Add Credit card type fields in contribution related reports
  https://issues.civicrm.org/jira/browse/CRM-19997

----------------------------------------
* CRM-20281:
  https://issues.civicrm.org/jira/browse/CRM-20281

CRM-20281 Added credit card type field for Soft Credit report

----------------------------------------
* CRM-20281: Add credit card type field for Soft Credit Report
  https://issues.civicrm.org/jira/browse/CRM-20281

CRM-20281 Fixed report to read from card type rather than credit card type

----------------------------------------
* CRM-20281: Add credit card type field for Soft Credit Report
  https://issues.civicrm.org/jira/browse/CRM-20281

CRM-20281 Removed line break

----------------------------------------
* CRM-20281:
  https://issues.civicrm.org/jira/browse/CRM-20281
  • Loading branch information
Edzelopez committed Mar 16, 2017
1 parent 6d4aa46 commit 075bcb1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions CRM/Report/Form/Contribute/SoftCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,24 @@ public function __construct() {
),
'grouping' => 'softcredit-fields',
),
'civicrm_financial_trxn' => array(
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type' => array(
'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type SEPARATOR ",")',
),
),
'filters' => array(
'card_type' => array(
'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialTrxn', 'card_type'),
'default' => NULL,
'type' => CRM_Utils_Type::T_STRING,
),
),
),
);

// If we have a campaign, build out the relevant elements
Expand Down Expand Up @@ -468,6 +486,15 @@ public function from() {
{$alias}.contact_id AND
{$alias}.is_primary = 1\n";
}
// for credit card type
if ($this->isTableSelected('civicrm_financial_trxn')) {
$this->_from .= "
LEFT JOIN civicrm_entity_financial_trxn eftcc
ON ({$this->_aliases['civicrm_contribution']}.id = eftcc.entity_id AND
eftcc.entity_table = 'civicrm_contribution')
LEFT JOIN civicrm_financial_trxn {$this->_aliases['civicrm_financial_trxn']}
ON {$this->_aliases['civicrm_financial_trxn']}.id = eftcc.financial_trxn_id";
}
}

public function groupBy() {
Expand Down Expand Up @@ -641,6 +668,11 @@ public function alterDisplay(&$rows) {
$entryFound = TRUE;
}

if (!empty($row['civicrm_financial_trxn_card_type'])) {
$rows[$rowNum]['civicrm_financial_trxn_card_type'] = $this->getLabels($row['civicrm_financial_trxn_card_type'], 'CRM_Financial_DAO_FinancialTrxn', 'card_type');
$entryFound = TRUE;
}

// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
Expand Down

0 comments on commit 075bcb1

Please sign in to comment.