civicrm_api3('FinancialTrxn', 'create', array('id' => $refundIDs['financialTrxnId'], 'trxn_id' => $params['refund_trxn_id']));
}
}
- $cardType = CRM_Utils_Array::value('card_type', $params);
+ $cardType = CRM_Utils_Array::value('card_type_id', $params);
$panTruncation = CRM_Utils_Array::value('pan_truncation', $params);
CRM_Core_BAO_FinancialTrxn::updateCreditCardDetails($params['contribution']->id, $panTruncation, $cardType);
}
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')
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}";
$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;
)
);
- $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,
$financialTrxnId = $financialTrxn['financial_trxn_id'];
$trxnparams = array('id' => $financialTrxnId);
if (isset($cardType)) {
- $trxnparams['card_type'] = $cardType;
+ $trxnparams['card_type_id'] = $cardType;
}
if (isset($panTruncation)) {
$trxnparams['pan_truncation'] = $panTruncation;
'default' => TRUE,
),
'card_type_id' => array(
- 'title' => ts('Credit Card Type ID'),
+ 'title' => ts('Credit Card Type'),
),
),
'filters' => array(
'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,
),
$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) &&
'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,
'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,
'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,
'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,
'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,
'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,
'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,
'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,
'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 ",")',
),
),
'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,
),
'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'),
'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,
{$form.contribution_check_number.label} <br />
{$form.contribution_check_number.html}
</div>
- <div class="float-left" id="financial_trxn_card_type_wrapper">
- {$form.financial_trxn_card_type.label} <br />
- {$form.financial_trxn_card_type.html}
+ <div class="float-left" id="financial_trxn_card_type_id_wrapper">
+ {$form.financial_trxn_card_type_id.label} <br />
+ {$form.financial_trxn_card_type_id.html}
</div>
<div class="float-left" id="pan_truncation_wrapper">
{$form.financial_trxn_pan_truncation.label} <br />
'FinancialTrxn',
array(
'id' => $lastFinancialTrxnId['financialTrxnId'],
- 'return' => array('card_type', 'pan_truncation'),
+ 'return' => array('card_type_id', 'pan_truncation'),
)
);
- $this->assertEquals(CRM_Utils_Array::value('card_type', $financialTrxn), NULL);
+ $this->assertEquals(CRM_Utils_Array::value('card_type_id', $financialTrxn), NULL);
$this->assertEquals(CRM_Utils_Array::value('pan_truncation', $financialTrxn), NULL);
$params = array(
- 'card_type' => 2,
+ 'card_type_id' => 2,
'pan_truncation' => 4567,
'id' => $contribution->id,
);
'FinancialTrxn',
array(
'id' => $lastFinancialTrxnId['financialTrxnId'],
- 'return' => array('card_type', 'pan_truncation'),
+ 'return' => array('card_type_id', 'pan_truncation'),
)
);
- $this->assertEquals($financialTrxn['card_type'], 2);
+ $this->assertEquals($financialTrxn['card_type_id'], 2);
$this->assertEquals($financialTrxn['pan_truncation'], 4567);
}
'FinancialTrxn',
array(
'id' => $lastFinancialTrxnId['financialTrxnId'],
- 'return' => array('card_type', 'pan_truncation'),
+ 'return' => array('card_type_id', 'pan_truncation'),
)
);
- $this->assertEquals(CRM_Utils_Array::value('card_type', $financialTrxn), NULL);
+ $this->assertEquals(CRM_Utils_Array::value('card_type_id', $financialTrxn), NULL);
$this->assertEquals(CRM_Utils_Array::value('pan_truncation', $financialTrxn), NULL);
CRM_Core_BAO_FinancialTrxn::updateCreditCardDetails($contribution->id, 4567, 2);
$financialTrxn = $this->callAPISuccessGetSingle(
'FinancialTrxn',
array(
'id' => $lastFinancialTrxnId['financialTrxnId'],
- 'return' => array('card_type', 'pan_truncation'),
+ 'return' => array('card_type_id', 'pan_truncation'),
)
);
- $this->assertEquals($financialTrxn['card_type'], 2);
+ $this->assertEquals($financialTrxn['card_type_id'], 2);
$this->assertEquals($financialTrxn['pan_truncation'], 4567);
}