Skip to content

Commit

Permalink
Additional fixes in report and Search form
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Apr 18, 2017
1 parent 5e0343e commit 9ab6223
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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}";
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contribute/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions CRM/Report/Form/Contribute/Bookkeeping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
),
Expand Down Expand Up @@ -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) &&
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/HouseholdSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Lybunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/OrganizationSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/PCP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Recur.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/SoftCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ 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'),
'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,
),
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/Sybunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions CRM/Report/Form/Contribute/TopDonor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Contribute/Form/Search/Common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
{$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 />
Expand Down

0 comments on commit 9ab6223

Please sign in to comment.