From 106bf8fd8daa48939d0b43aa2e8e508e32000472 Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 15 Feb 2017 16:49:22 +0530 Subject: [PATCH] CRM-20282 Added credit card type field to bookkeeping report ---------------------------------------- * CRM-19997: Add Credit card type fields in contribution related reports https://issues.civicrm.org/jira/browse/CRM-19997 ---------------------------------------- * CRM-20282: https://issues.civicrm.org/jira/browse/CRM-20282 CRM-20282 Fixed report to read from card type rather than credit card type ---------------------------------------- * CRM-20282: Add credit card type field for Bookkeeping report https://issues.civicrm.org/jira/browse/CRM-20282 --- CRM/Report/Form/Contribute/Bookkeeping.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index 3cbe603608..51ad22ca79 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -315,6 +315,9 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { 'title' => ts('Trans #'), 'default' => TRUE, ), + 'card_type' => array( + 'title' => ts('Credit Card Type'), + ), ), 'filters' => array( 'payment_instrument_id' => array( @@ -341,6 +344,13 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array(1), ), + 'card_type' => array( + 'title' => ts('Credit Card Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialTrxn', 'card_type'), + 'default' => NULL, + 'type' => CRM_Utils_Type::T_STRING, + ), ), 'order_bys' => array( 'payment_instrument_id' => array('title' => ts('Payment Method')), @@ -602,6 +612,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { $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'); foreach ($rows as $rowNum => $row) { // convert display name to links if (array_key_exists('civicrm_contact_sort_name', $row) && @@ -643,6 +654,11 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { $entryFound = TRUE; } + if (!empty($row['civicrm_financial_trxn_card_type'])) { + $rows[$rowNum]['civicrm_financial_trxn_card_type'] = CRM_Utils_Array::value($row['civicrm_financial_trxn_card_type'], $creditCardTypes); + $entryFound = TRUE; + } + // display birthday in the configured custom format if (array_key_exists('civicrm_contact_birth_date', $row)) { $birthDate = $row['civicrm_contact_birth_date']; -- 2.25.1