From 0ddcd8e9f8b108455afd89a3f23ae2f4ef1e623e Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 15 Feb 2017 16:19:06 +0530 Subject: [PATCH] CRM-20279 Added credit card type field to SYBUNT report ---------------------------------------- * CRM-19997: Add Credit card type fields in contribution related reports https://issues.civicrm.org/jira/browse/CRM-19997 ---------------------------------------- * CRM-20279: https://issues.civicrm.org/jira/browse/CRM-20279 CRM-20279 Added credit card type field for SYBUNT report ---------------------------------------- * CRM-20279: Add credit card type field for SYBUNT report https://issues.civicrm.org/jira/browse/CRM-20279 CRM-20279 Fixed report to read from card type rather than credit card type ---------------------------------------- * CRM-20279: Add credit card type field for SYBUNT report https://issues.civicrm.org/jira/browse/CRM-20279 CRM-20279 Removed line break ---------------------------------------- * CRM-20279: https://issues.civicrm.org/jira/browse/CRM-20279 --- CRM/Report/Form/Contribute/Sybunt.php | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index a42bb1623b..0892bb172d 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -246,6 +246,26 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { ), ), ); + $this->_columns += array( + '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, + 'default' => NULL, + 'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type'), + 'type' => CRM_Utils_Type::T_STRING, + ), + ), + ), + ); // If we have a campaign, build out the relevant elements if ($campaignEnabled && !empty($this->activeCampaigns)) { @@ -344,6 +364,9 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND {$this->_aliases['civicrm_phone']}.is_primary = 1"; } + // for credit card type + $this->addFinancialTrxnFromClause(); + $this->addAddressFromClause(); } @@ -612,6 +635,11 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $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) { -- 2.25.1