3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2018
33 class CRM_Report_Form_Contribute_Bookkeeping
extends CRM_Report_Form
{
35 protected $_summary = NULL;
37 protected $_customGroupExtends = array(
45 * This report has not been optimised for group filtering.
47 * The functionality for group filtering has been improved but not
48 * all reports have been adjusted to take care of it. This report has not
49 * and will run an inefficient query until fixed.
55 protected $groupFilterNotOptimised = TRUE;
60 public function __construct() {
61 $this->_autoIncludeIndexedFieldsAsOrderBys
= 1;
62 $this->_columns
= array(
63 'civicrm_contact' => array(
64 'dao' => 'CRM_Contact_DAO_Contact',
67 'title' => ts('Contact Name'),
71 'first_name' => array(
72 'title' => ts('First Name'),
74 'middle_name' => array(
75 'title' => ts('Middle Name'),
78 'title' => ts('Last Name'),
85 'title' => ts('Gender'),
87 'birth_date' => array(
88 'title' => ts('Birth Date'),
92 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
94 'contact_type' => array(
95 'title' => ts('Contact Type'),
97 'contact_sub_type' => array(
98 'title' => ts('Contact Subtype'),
101 'grouping' => 'contact-fields',
102 'order_bys' => array(
103 'sort_name' => array(
104 'title' => ts('Last Name, First Name'),
106 'default_weight' => '0',
107 'default_order' => 'ASC',
109 'first_name' => array(
110 'name' => 'first_name',
111 'title' => ts('First Name'),
113 'gender_id' => array(
114 'name' => 'gender_id',
115 'title' => ts('Gender'),
117 'birth_date' => array(
118 'name' => 'birth_date',
119 'title' => ts('Birth Date'),
121 'contact_type' => array(
122 'title' => ts('Contact Type'),
124 'contact_sub_type' => array(
125 'title' => ts('Contact Subtype'),
129 'sort_name' => array(
130 'title' => ts('Contact Name'),
131 'operator' => 'like',
134 'title' => ts('Contact ID'),
135 'no_display' => TRUE,
137 'gender_id' => array(
138 'title' => ts('Gender'),
139 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
140 'options' => CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'gender_id'),
142 'birth_date' => array(
143 'title' => ts('Birth Date'),
144 'operatorType' => CRM_Report_Form
::OP_DATE
,
146 'contact_type' => array(
147 'title' => ts('Contact Type'),
149 'contact_sub_type' => array(
150 'title' => ts('Contact Subtype'),
154 'civicrm_membership' => array(
155 'dao' => 'CRM_Member_DAO_Membership',
158 'title' => ts('Membership #'),
159 'no_display' => TRUE,
164 'civicrm_financial_account' => array(
165 'dao' => 'CRM_Financial_DAO_FinancialAccount',
167 'debit_accounting_code' => array(
168 'title' => ts('Financial Account Code - Debit'),
169 'name' => 'accounting_code',
170 'alias' => 'financial_account_civireport_debit',
173 'debit_contact_id' => array(
174 'title' => ts('Financial Account Owner - Debit'),
175 'name' => 'organization_name',
176 'alias' => 'debit_contact',
178 'credit_accounting_code' => array(
179 'title' => ts('Financial Account Code - Credit'),
180 'name' => 'accounting_code',
181 'alias' => 'financial_account_civireport_credit',
184 'credit_contact_id' => array(
185 'title' => ts('Financial Account Owner - Credit'),
186 'name' => 'organization_name',
187 'alias' => 'credit_contact',
189 'debit_name' => array(
190 'title' => ts('Financial Account Name - Debit'),
192 'alias' => 'financial_account_civireport_debit',
195 'credit_name' => array(
196 'title' => ts('Financial Account Name - Credit'),
198 'alias' => 'financial_account_civireport_credit',
203 'debit_accounting_code' => array(
204 'title' => ts('Financial Account Code - Debit'),
205 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
206 'options' => CRM_Contribute_PseudoConstant
::financialAccount(NULL, NULL, 'accounting_code', 'accounting_code'),
207 'name' => 'accounting_code',
208 'alias' => 'financial_account_civireport_debit',
210 'debit_contact_id' => array(
211 'title' => ts('Financial Account Owner - Debit'),
212 'operatorType' => CRM_Report_Form
::OP_SELECT
,
213 'type' => CRM_Utils_Type
::T_INT
,
214 'options' => array('' => '- Select Organization -') + CRM_Financial_BAO_FinancialAccount
::getOrganizationNames(),
215 'name' => 'contact_id',
216 'alias' => 'financial_account_civireport_debit',
218 'credit_accounting_code' => array(
219 'title' => ts('Financial Account Code - Credit'),
220 'type' => CRM_Utils_Type
::T_INT
,
221 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
222 'options' => CRM_Contribute_PseudoConstant
::financialAccount(NULL, NULL, 'accounting_code', 'accounting_code'),
223 'name' => 'accounting_code',
224 'alias' => 'financial_account_civireport_credit',
226 'credit_contact_id' => array(
227 'title' => ts('Financial Account Owner - Credit'),
228 'operatorType' => CRM_Report_Form
::OP_SELECT
,
229 'type' => CRM_Utils_Type
::T_INT
,
230 'options' => array('' => '- Select Organization -') + CRM_Financial_BAO_FinancialAccount
::getOrganizationNames(),
231 'name' => 'contact_id',
232 'alias' => 'financial_account_civireport_credit',
234 'debit_name' => array(
235 'title' => ts('Financial Account Name - Debit'),
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
238 'options' => CRM_Contribute_PseudoConstant
::financialAccount(),
240 'alias' => 'financial_account_civireport_debit',
242 'credit_name' => array(
243 'title' => ts('Financial Account Name - Credit'),
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
246 'options' => CRM_Contribute_PseudoConstant
::financialAccount(),
248 'alias' => 'financial_account_civireport_credit',
252 'civicrm_line_item' => array(
253 'dao' => 'CRM_Price_DAO_LineItem',
255 'financial_type_id' => array(
256 'title' => ts('Financial Type'),
261 'financial_type_id' => array(
262 'title' => ts('Financial Type'),
263 'type' => CRM_Utils_Type
::T_INT
,
264 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
265 'options' => CRM_Financial_BAO_FinancialType
::getAvailableFinancialTypes(),
268 'order_bys' => array(
269 'financial_type_id' => array('title' => ts('Financial Type')),
272 'civicrm_batch' => array(
273 'dao' => 'CRM_Batch_DAO_Batch',
276 'title' => ts('Batch Title'),
281 'title' => ts('Batch Name'),
287 'civicrm_contribution' => array(
288 'dao' => 'CRM_Contribute_DAO_Contribution',
290 'receive_date' => array(
293 'invoice_id' => array(
294 'title' => ts('Invoice Reference'),
297 'invoice_number' => array(
298 'title' => ts('Invoice Number'),
300 'contribution_status_id' => array(
301 'title' => ts('Contribution Status'),
305 'title' => ts('Contribution ID'),
310 'contribution_id' => array(
311 'title' => ts('Contribution ID'),
313 'operatorType' => CRM_Report_Form
::OP_INT
,
314 'type' => CRM_Utils_Type
::T_INT
,
316 'receive_date' => array('operatorType' => CRM_Report_Form
::OP_DATE
),
317 'contribution_status_id' => array(
318 'title' => ts('Contribution Status'),
319 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
320 'options' => CRM_Contribute_PseudoConstant
::contributionStatus(),
321 'default' => array(1),
324 'order_bys' => array(
325 'contribution_id' => array('title' => ts('Contribution #')),
326 'contribution_status_id' => array('title' => ts('Contribution Status')),
328 'grouping' => 'contri-fields',
330 'civicrm_financial_trxn' => array(
331 'dao' => 'CRM_Financial_DAO_FinancialTrxn',
333 'check_number' => array(
334 'title' => ts('Cheque #'),
337 'payment_instrument_id' => array(
338 'title' => ts('Payment Method'),
343 'no_display' => TRUE,
345 'trxn_date' => array(
346 'title' => ts('Transaction Date'),
348 'type' => CRM_Utils_Type
::T_DATE
,
351 'title' => ts('Trans #'),
354 'card_type_id' => array(
355 'title' => ts('Credit Card Type'),
359 'payment_instrument_id' => array(
360 'title' => ts('Payment Method'),
361 'type' => CRM_Utils_Type
::T_INT
,
362 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
363 'options' => CRM_Contribute_PseudoConstant
::paymentInstrument(),
366 'title' => ts('Currency'),
367 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
368 'options' => CRM_Core_OptionGroup
::values('currencies_enabled'),
370 'type' => CRM_Utils_Type
::T_STRING
,
372 'trxn_date' => array(
373 'title' => ts('Transaction Date'),
374 'operatorType' => CRM_Report_Form
::OP_DATE
,
375 'type' => CRM_Utils_Type
::T_DATE
,
377 'status_id' => array(
378 'title' => ts('Financial Transaction Status'),
379 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
380 'options' => CRM_Contribute_PseudoConstant
::contributionStatus(),
381 'default' => array(1),
383 'card_type_id' => array(
384 'title' => ts('Credit Card Type'),
385 'operatorType' => CRM_Report_Form
::OP_MULTISELECT
,
386 'options' => CRM_Financial_DAO_FinancialTrxn
::buildOptions('card_type_id'),
388 'type' => CRM_Utils_Type
::T_STRING
,
391 'order_bys' => array(
392 'payment_instrument_id' => array('title' => ts('Payment Method')),
395 'civicrm_entity_financial_trxn' => array(
396 'dao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
399 'title' => ts('Amount'),
401 'type' => CRM_Utils_Type
::T_STRING
,
405 'amount' => array('title' => ts('Amount')),
410 $this->_groupFilter
= TRUE;
411 $this->_tagFilter
= TRUE;
412 parent
::__construct();
415 public function preProcess() {
416 parent
::preProcess();
419 public function select() {
422 $this->_columnHeaders
= array();
423 foreach ($this->_columns
as $tableName => $table) {
424 if (array_key_exists('fields', $table)) {
425 foreach ($table['fields'] as $fieldName => $field) {
426 if (!empty($field['required']) ||
427 !empty($this->_params
['fields'][$fieldName])
429 switch ($fieldName) {
430 case 'credit_accounting_code':
433 WHEN {$this->_aliases['civicrm_financial_trxn']}.from_financial_account_id IS NOT NULL
434 THEN {$this->_aliases['civicrm_financial_account']}_credit_1.{$field['name']}
435 ELSE {$this->_aliases['civicrm_financial_account']}_credit_2.{$field['name']}
436 END AS civicrm_financial_account_{$fieldName} ";
441 WHEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.entity_id IS NOT NULL
442 THEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.amount
443 ELSE {$this->_aliases['civicrm_entity_financial_trxn']}.amount
444 END AS civicrm_entity_financial_trxn_amount ";
447 case 'credit_contact_id':
449 WHEN {$this->_aliases['civicrm_financial_trxn']}.from_financial_account_id IS NOT NULL
450 THEN credit_contact_1.{$field['name']}
451 ELSE credit_contact_2.{$field['name']}
452 END AS civicrm_financial_account_{$fieldName} ";
456 $select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
459 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['title'] = $field['title'];
460 $this->_columnHeaders
["{$tableName}_{$fieldName}"]['type'] = CRM_Utils_Array
::value('type', $field);
465 $this->_selectClauses
= $select;
467 $this->_select
= 'SELECT ' . implode(', ', $select) . ' ';
470 public function from() {
473 $this->_from
= "FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}
474 INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
475 ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id AND
476 {$this->_aliases['civicrm_contribution']}.is_test = 0
477 LEFT JOIN civicrm_membership_payment payment
478 ON ( {$this->_aliases['civicrm_contribution']}.id = payment.contribution_id )
479 LEFT JOIN civicrm_membership {$this->_aliases['civicrm_membership']}
480 ON payment.membership_id = {$this->_aliases['civicrm_membership']}.id
481 LEFT JOIN civicrm_entity_financial_trxn {$this->_aliases['civicrm_entity_financial_trxn']}
482 ON ({$this->_aliases['civicrm_contribution']}.id = {$this->_aliases['civicrm_entity_financial_trxn']}.entity_id AND
483 {$this->_aliases['civicrm_entity_financial_trxn']}.entity_table = 'civicrm_contribution')
484 LEFT JOIN civicrm_financial_trxn {$this->_aliases['civicrm_financial_trxn']}
485 ON {$this->_aliases['civicrm_financial_trxn']}.id = {$this->_aliases['civicrm_entity_financial_trxn']}.financial_trxn_id
486 LEFT JOIN civicrm_financial_account {$this->_aliases['civicrm_financial_account']}_debit
487 ON {$this->_aliases['civicrm_financial_trxn']}.to_financial_account_id = {$this->_aliases['civicrm_financial_account']}_debit.id
488 LEFT JOIN civicrm_contact debit_contact ON {$this->_aliases['civicrm_financial_account']}_debit.contact_id = debit_contact.id
489 LEFT JOIN civicrm_financial_account {$this->_aliases['civicrm_financial_account']}_credit_1
490 ON {$this->_aliases['civicrm_financial_trxn']}.from_financial_account_id = {$this->_aliases['civicrm_financial_account']}_credit_1.id
491 LEFT JOIN civicrm_contact credit_contact_1 ON {$this->_aliases['civicrm_financial_account']}_credit_1.contact_id = credit_contact_1.id
492 LEFT JOIN civicrm_entity_financial_trxn {$this->_aliases['civicrm_entity_financial_trxn']}_item
493 ON ({$this->_aliases['civicrm_financial_trxn']}.id = {$this->_aliases['civicrm_entity_financial_trxn']}_item.financial_trxn_id AND
494 {$this->_aliases['civicrm_entity_financial_trxn']}_item.entity_table = 'civicrm_financial_item')
495 LEFT JOIN civicrm_financial_item fitem
496 ON fitem.id = {$this->_aliases['civicrm_entity_financial_trxn']}_item.entity_id
497 LEFT JOIN civicrm_financial_account {$this->_aliases['civicrm_financial_account']}_credit_2
498 ON fitem.financial_account_id = {$this->_aliases['civicrm_financial_account']}_credit_2.id
499 LEFT JOIN civicrm_contact credit_contact_2 ON {$this->_aliases['civicrm_financial_account']}_credit_2.contact_id = credit_contact_2.id
500 LEFT JOIN civicrm_line_item {$this->_aliases['civicrm_line_item']}
501 ON fitem.entity_id = {$this->_aliases['civicrm_line_item']}.id AND fitem.entity_table = 'civicrm_line_item'
504 if ($this->isTableSelected('civicrm_batch')) {
505 $this->_from
.= "LEFT JOIN civicrm_entity_batch ent_batch
506 ON {$this->_aliases['civicrm_financial_trxn']}.id = ent_batch.entity_id AND ent_batch.entity_table = 'civicrm_financial_trxn'
507 LEFT JOIN civicrm_batch batch
508 ON ent_batch.batch_id = batch.id";
512 public function orderBy() {
515 // please note this will just add the order-by columns to select query, and not display in column-headers.
516 // This is a solution to not throw fatal errors when there is a column in order-by, not present in select/display columns.
517 foreach ($this->_orderByFields
as $orderBy) {
518 if (!array_key_exists($orderBy['name'], $this->_params
['fields']) &&
519 empty($orderBy['section'])
521 $this->_select
.= ", {$orderBy['dbAlias']} as {$orderBy['tplField']}";
526 public function where() {
527 foreach ($this->_columns
as $tableName => $table) {
528 if (array_key_exists('filters', $table)) {
529 foreach ($table['filters'] as $fieldName => $field) {
531 if (in_array($fieldName, array(
532 'credit_accounting_code',
537 $field['dbAlias'] = "CASE
538 WHEN financial_trxn_civireport.from_financial_account_id IS NOT NULL
539 THEN financial_account_civireport_credit_1.{$field['name']}
540 ELSE financial_account_civireport_credit_2.{$field['name']}
543 if (CRM_Utils_Array
::value('type', $field) & CRM_Utils_Type
::T_DATE
) {
544 $relative = CRM_Utils_Array
::value("{$fieldName}_relative", $this->_params
);
545 $from = CRM_Utils_Array
::value("{$fieldName}_from", $this->_params
);
546 $to = CRM_Utils_Array
::value("{$fieldName}_to", $this->_params
);
548 $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
551 $op = CRM_Utils_Array
::value("{$fieldName}_op", $this->_params
);
553 $clause = $this->whereClause($field,
555 CRM_Utils_Array
::value("{$fieldName}_value", $this->_params
),
556 CRM_Utils_Array
::value("{$fieldName}_min", $this->_params
),
557 CRM_Utils_Array
::value("{$fieldName}_max", $this->_params
)
561 if (!empty($clause)) {
562 $clauses[] = $clause;
567 if (empty($clauses)) {
568 $this->_where
= 'WHERE ( 1 )';
571 $this->_where
= 'WHERE ' . implode(' AND ', $clauses);
575 public function postProcess() {
576 // get the acl clauses built before we assemble the query
577 $this->buildACLClause($this->_aliases
['civicrm_contact']);
578 parent
::postProcess();
581 public function groupBy() {
583 "{$this->_aliases['civicrm_entity_financial_trxn']}.id",
584 "{$this->_aliases['civicrm_line_item']}.id",
586 $this->_groupBy
= CRM_Contact_BAO_Query
::getGroupByFromSelectColumns($this->_selectClauses
, $groupBy);
594 public function statistics(&$rows) {
595 $statistics = parent
::statistics($rows);
596 $tempTableName = CRM_Core_DAO
::createTempTableName('civicrm_contribution');
597 $financialSelect = "CASE WHEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.entity_id IS NOT NULL
598 THEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.amount
599 ELSE {$this->_aliases['civicrm_entity_financial_trxn']}.amount
602 $this->_selectClauses
= array(
603 "{$this->_aliases['civicrm_contribution']}.id",
604 "{$this->_aliases['civicrm_entity_financial_trxn']}.id as trxnID",
605 "{$this->_aliases['civicrm_contribution']}.currency",
608 $select = "SELECT " . implode(', ', $this->_selectClauses
);
612 $tempQuery = "CREATE TEMPORARY TABLE {$tempTableName} {$this->_databaseAttributes} AS
613 {$select} {$this->_from} {$this->_where} {$this->_groupBy} ";
614 CRM_Core_DAO
::executeQuery($tempQuery);
616 $sql = "SELECT COUNT(trxnID) as count, SUM(amount) as amount, currency
617 FROM {$tempTableName}
619 $dao = CRM_Core_DAO
::executeQuery($sql);
620 $amount = $avg = array();
621 while ($dao->fetch()) {
622 $amount[] = CRM_Utils_Money
::format($dao->amount
, $dao->currency
);
623 $avg[] = CRM_Utils_Money
::format(round(($dao->amount
/
624 $dao->count
), 2), $dao->currency
);
627 $statistics['counts']['amount'] = array(
628 'value' => implode(', ', $amount),
629 'title' => ts('Total Amount'),
630 'type' => CRM_Utils_Type
::T_STRING
,
632 $statistics['counts']['avg'] = array(
633 'value' => implode(', ', $avg),
634 'title' => ts('Average'),
635 'type' => CRM_Utils_Type
::T_STRING
,
641 * Alter display of rows.
643 * Iterate through the rows retrieved via SQL and make changes for display purposes,
644 * such as rendering contacts as links.
647 * Rows generated by SQL, with an array for each row.
649 public function alterDisplay(&$rows) {
650 $contributionTypes = CRM_Contribute_PseudoConstant
::financialType();
651 $paymentInstruments = CRM_Contribute_PseudoConstant
::paymentInstrument();
652 $contributionStatus = CRM_Contribute_PseudoConstant
::contributionStatus();
653 $creditCardTypes = CRM_Financial_DAO_FinancialTrxn
::buildOptions('card_type_id');
654 foreach ($rows as $rowNum => $row) {
655 // convert display name to links
656 if (array_key_exists('civicrm_contact_sort_name', $row) &&
657 !empty($rows[$rowNum]['civicrm_contact_sort_name']) &&
658 array_key_exists('civicrm_contact_id', $row)
660 $url = CRM_Utils_System
::url('civicrm/contact/view',
661 'reset=1&cid=' . $row['civicrm_contact_id'],
664 $rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
665 $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts('View Contact Summary for this Contact.');
668 // handle contribution status id
669 if ($value = CRM_Utils_Array
::value('civicrm_contribution_contribution_status_id', $row)) {
670 $rows[$rowNum]['civicrm_contribution_contribution_status_id'] = $contributionStatus[$value];
673 // handle payment instrument id
674 if ($value = CRM_Utils_Array
::value('civicrm_financial_trxn_payment_instrument_id', $row)) {
675 $rows[$rowNum]['civicrm_financial_trxn_payment_instrument_id'] = $paymentInstruments[$value];
678 // handle financial type id
679 if ($value = CRM_Utils_Array
::value('civicrm_line_item_financial_type_id', $row)) {
680 $rows[$rowNum]['civicrm_line_item_financial_type_id'] = $contributionTypes[$value];
682 if ($value = CRM_Utils_Array
::value('civicrm_entity_financial_trxn_amount', $row)) {
683 $rows[$rowNum]['civicrm_entity_financial_trxn_amount'] = CRM_Utils_Money
::format($rows[$rowNum]['civicrm_entity_financial_trxn_amount'], $rows[$rowNum]['civicrm_financial_trxn_currency']);
687 if (array_key_exists('civicrm_contact_gender_id', $row)) {
688 if ($value = $row['civicrm_contact_gender_id']) {
689 $gender = CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'gender_id');
690 $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
695 if (!empty($row['civicrm_financial_trxn_card_type_id'])) {
696 $rows[$rowNum]['civicrm_financial_trxn_card_type_id'] = CRM_Utils_Array
::value($row['civicrm_financial_trxn_card_type_id'], $creditCardTypes);
700 // display birthday in the configured custom format
701 if (array_key_exists('civicrm_contact_birth_date', $row)) {
702 $birthDate = $row['civicrm_contact_birth_date'];
704 $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date
::customFormat($birthDate, '%Y%m%d');