From 67d56bb58b385ab6fd4b2ccd1bf12ab26809d428 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Thu, 23 Mar 2017 18:24:57 +0530 Subject: [PATCH] CRM-20331, added code to show card type and pan truncation besides payment method under transaction listing for contribution ---------------------------------------- * CRM-20331: Add card type and pan truncation besides payment method https://issues.civicrm.org/jira/browse/CRM-20331 --- CRM/Contribute/BAO/Contribution.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 60b197bd78..399e76f5a8 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4053,7 +4053,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) 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, con.currency + ft.trxn_date, ft.trxn_id, ft.status_id, ft.check_number, ft.currency, ft.pan_truncation, ft.card_type FROM civicrm_contribution con LEFT JOIN civicrm_entity_financial_trxn eft ON (eft.entity_id = con.id AND eft.entity_table = 'civicrm_contribution') @@ -4075,6 +4075,14 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) 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); + $pantruncation = ''; + if ($resultDAO->pan_truncation) { + $pantruncation = ": {$resultDAO->pan_truncation}"; + } + $paidByLabel .= " ({$creditCardType}{$pantruncation})"; + } $val = array( 'total_amount' => $resultDAO->total_amount, 'financial_type' => $resultDAO->financial_account, -- 2.25.1