<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
protected $_customGroupExtends = array( 'Contribution');
+ /**
+ *
+ */
+ /**
+ *
+ */
function __construct() {
// Check if CiviCampaign is a) enabled and b) has active campaigns
'name' => 'id',
'title' => ts('Contribution ID'),
),
- 'contribution_or_soft' =>
- array('title' => ts('Contribution OR Soft Credit?'),
- 'dbAlias' => "'Contribution'"
- ),
- 'soft_credits' =>
- array('title' => ts('Soft Credits'),
- 'dbAlias' => "NULL"
- ),
- 'soft_credit_for' =>
- array('title' => ts('Soft Credit For'),
- 'dbAlias' => "NULL"
- ),
'financial_type_id' => array('title' => ts('Financial Type'),
'default' => TRUE,
),
'trxn_id' => NULL,
'receive_date' => array('default' => TRUE),
'receipt_date' => NULL,
- 'fee_amount' => NULL,
- 'net_amount' => NULL,
'total_amount' => array('title' => ts('Amount'),
'required' => TRUE,
'statistics' =>
array('sum' => ts('Amount')),
),
+ 'fee_amount' => NULL,
+ 'net_amount' => NULL,
+ 'contribution_or_soft' =>
+ array('title' => ts('Contribution OR Soft Credit?'),
+ 'dbAlias' => "'Contribution'"
+ ),
+ 'soft_credits' =>
+ array('title' => ts('Soft Credits'),
+ 'dbAlias' => "NULL"
+ ),
+ 'soft_credit_for' =>
+ array('title' => ts('Soft Credit For'),
+ 'dbAlias' => "NULL"
+ ),
),
'filters' =>
array(
'financial_type_id' => array('title' => ts('Financial Type')),
'contribution_status_id' => array('title' => ts('Contribution Status')),
'payment_instrument_id' => array('title' => ts('Payment Instrument')),
+ 'receive_date' => array('title' => ts('Receive Date')),
),
'grouping' => 'contri-fields',
),
$this->_columnHeaders = array();
parent::select();
+ //total_amount was affected by sum as it is considered as one of the stat field
+ //so it is been replaced with correct alias, CRM-13833
+ $this->_select = str_replace("sum({$this->_aliases['civicrm_contribution']}.total_amount)", "{$this->_aliases['civicrm_contribution']}.total_amount", $this->_select);
}
function orderBy() {
}
}
+ /**
+ * @param bool $softcredit
+ */
function from($softcredit = FALSE) {
$this->_from = "
FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom}
$this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.id ";
}
+ /**
+ * @param $rows
+ *
+ * @return array
+ */
function statistics(&$rows) {
$statistics = parent::statistics($rows);
$this->endPostProcess($rows);
}
+ /**
+ * @param $rows
+ */
function alterDisplay(&$rows) {
// custom code to alter rows
$checkList = array();
}
}
-
+ if (CRM_Utils_Array::value('civicrm_contribution_contribution_or_soft', $rows[$rowNum]) == 'Contribution') {
+ unset($rows[$rowNum]['civicrm_contribution_soft_soft_credit_type_id']);
+ }
// convert donor sort name to link
if (array_key_exists('civicrm_contact_sort_name', $row) && !empty($rows[$rowNum]['civicrm_contact_sort_name']) &&