diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index a196c7c53bcb..517ba4583d4f 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -4066,7 +4066,7 @@ public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $us
SELECT GROUP_CONCAT(fa.`name`) as financial_account,
ft.total_amount,
ft.payment_instrument_id,
- ft.trxn_date, ft.trxn_id, ft.status_id, ft.check_number, ft.currency, ft.pan_truncation, ft.card_type
+ ft.trxn_date, ft.trxn_id, ft.status_id, ft.check_number, ft.currency, ft.pan_truncation, ft.card_type_id
FROM civicrm_contribution con
LEFT JOIN civicrm_entity_financial_trxn eft ON (eft.entity_id = con.id AND eft.entity_table = 'civicrm_contribution')
@@ -4088,8 +4088,8 @@ public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $us
while ($resultDAO->fetch()) {
$paidByLabel = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $resultDAO->payment_instrument_id);
$paidByName = CRM_Core_PseudoConstant::getName('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $resultDAO->payment_instrument_id);
- if ($resultDAO->card_type) {
- $creditCardType = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'card_type', $resultDAO->card_type);
+ if ($resultDAO->card_type_id) {
+ $creditCardType = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'card_type_id', $resultDAO->card_type_id);
$pantruncation = '';
if ($resultDAO->pan_truncation) {
$pantruncation = ": {$resultDAO->pan_truncation}";
diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php
index 416cf0a9c104..185f38cfe753 100644
--- a/CRM/Contribute/BAO/Query.php
+++ b/CRM/Contribute/BAO/Query.php
@@ -443,11 +443,11 @@ public static function whereClauseSingle(&$values, &$query) {
$query->_tables['civicrm_financial_trxn'] = $query->_whereTables['civicrm_financial_trxn'] = 1;
return;
- case 'financial_trxn_card_type':
- $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_financial_trxn.card_type', $op, $value);
+ case 'financial_trxn_card_type_id':
+ $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause('civicrm_financial_trxn.card_type_id', $op, $value);
$query->_tables['civicrm_financial_trxn'] = $query->_whereTables['civicrm_financial_trxn'] = 1;
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
- list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Financial_DAO_FinancialTrxn', 'card_type', $value, $op);
+ list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Financial_DAO_FinancialTrxn', 'card_type_id', $value, $op);
$query->_qill[$grouping][] = ts('Card Type %1 %2', array(1 => $op, 2 => $value));
return;
@@ -967,7 +967,7 @@ public static function buildSearchForm(&$form) {
)
);
- $form->addField('financial_trxn_card_type', array('entity' => 'FinancialTrxn', 'name' => 'card_type', 'action' => 'get'));
+ $form->addField('financial_trxn_card_type_id', array('entity' => 'FinancialTrxn', 'name' => 'card_type_id', 'action' => 'get'));
$form->add('text', 'financial_trxn_pan_truncation', ts('Card Number'), array(
'size' => 5,
diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php
index 351dcb729838..0309e36e31f0 100644
--- a/CRM/Report/Form/Contribute/Bookkeeping.php
+++ b/CRM/Report/Form/Contribute/Bookkeeping.php
@@ -348,7 +348,7 @@ public function __construct() {
'default' => TRUE,
),
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
),
),
'filters' => array(
@@ -377,9 +377,9 @@ public function __construct() {
'default' => array(1),
),
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialTrxn', 'card_type_id'),
+ 'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
'type' => CRM_Utils_Type::T_STRING,
),
@@ -648,7 +648,7 @@ public function alterDisplay(&$rows) {
$contributionTypes = CRM_Contribute_PseudoConstant::financialType();
$paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument();
$contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus();
- $creditCardTypes = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialTrxn', 'card_type_id');
+ $creditCardTypes = CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id');
foreach ($rows as $rowNum => $row) {
// convert display name to links
if (array_key_exists('civicrm_contact_sort_name', $row) &&
diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php
index 600e0daf371c..81f72ac16e56 100644
--- a/CRM/Report/Form/Contribute/Detail.php
+++ b/CRM/Report/Form/Contribute/Detail.php
@@ -293,13 +293,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php
index 85563c377772..0cb76f1fad74 100644
--- a/CRM/Report/Form/Contribute/History.php
+++ b/CRM/Report/Form/Contribute/History.php
@@ -274,13 +274,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php
index ac8da1e4afb0..43135d64e31f 100644
--- a/CRM/Report/Form/Contribute/HouseholdSummary.php
+++ b/CRM/Report/Form/Contribute/HouseholdSummary.php
@@ -165,13 +165,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php
index 8ac77ee3db1a..b0877276d6d6 100644
--- a/CRM/Report/Form/Contribute/Lybunt.php
+++ b/CRM/Report/Form/Contribute/Lybunt.php
@@ -253,13 +253,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php
index bec6fff7cf37..9a310fe91d87 100644
--- a/CRM/Report/Form/Contribute/OrganizationSummary.php
+++ b/CRM/Report/Form/Contribute/OrganizationSummary.php
@@ -197,13 +197,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php
index 22d57dbf5643..bc3506824efa 100644
--- a/CRM/Report/Form/Contribute/PCP.php
+++ b/CRM/Report/Form/Contribute/PCP.php
@@ -170,13 +170,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php
index d3510c2002e9..602b8f5607fb 100644
--- a/CRM/Report/Form/Contribute/Recur.php
+++ b/CRM/Report/Form/Contribute/Recur.php
@@ -110,13 +110,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php
index 45806b552422..0ad8445917a2 100644
--- a/CRM/Report/Form/Contribute/SoftCredit.php
+++ b/CRM/Report/Form/Contribute/SoftCredit.php
@@ -306,13 +306,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php
index 16984a8f3ca2..5fd12b81bac2 100644
--- a/CRM/Report/Form/Contribute/Summary.php
+++ b/CRM/Report/Form/Contribute/Summary.php
@@ -230,7 +230,7 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
@@ -238,7 +238,7 @@ public function __construct() {
'card_type_id' => array(
'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialTrxn', 'card_type_id'),
+ 'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
'type' => CRM_Utils_Type::T_STRING,
),
diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php
index 2b428bdbe375..2299e9d7b8df 100644
--- a/CRM/Report/Form/Contribute/Sybunt.php
+++ b/CRM/Report/Form/Contribute/Sybunt.php
@@ -251,13 +251,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'default' => NULL,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php
index 766a8927555c..8a7ad5bead85 100644
--- a/CRM/Report/Form/Contribute/TopDonor.php
+++ b/CRM/Report/Form/Contribute/TopDonor.php
@@ -166,13 +166,13 @@ public function __construct() {
'dao' => 'CRM_Financial_DAO_FinancialTrxn',
'fields' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'dbAlias' => 'GROUP_CONCAT(financial_trxn_civireport.card_type_id SEPARATOR ",")',
),
),
'filters' => array(
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => CRM_Financial_DAO_FinancialTrxn::buildOptions('card_type_id'),
'default' => NULL,
diff --git a/templates/CRM/Contribute/Form/Search/Common.tpl b/templates/CRM/Contribute/Form/Search/Common.tpl
index f1bd95f629d2..2e601e47a0b4 100644
--- a/templates/CRM/Contribute/Form/Search/Common.tpl
+++ b/templates/CRM/Contribute/Form/Search/Common.tpl
@@ -47,9 +47,9 @@
{$form.contribution_check_number.label}
{$form.contribution_check_number.html}
-