$group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency";
$this->from('contribution');
+ if ($softCredit) {
+ $this->from();
+ }
$this->customDataFrom();
+ // Ensure that Extensions that modify the from statement in the sql also modify it in the statistics.
+ CRM_Utils_Hook::alterReportVar('sql', $this, $this);
+
$contriQuery = "
COUNT({$this->_aliases['civicrm_contribution']}.total_amount ) as civicrm_contribution_total_amount_count,
SUM({$this->_aliases['civicrm_contribution']}.total_amount ) as civicrm_contribution_total_amount_sum,
{$this->_from} {$this->_where}";
if ($softCredit) {
- $this->from();
- $this->customDataFrom();
$select = "
COUNT({$this->_aliases['civicrm_contribution_soft']}.amount ) as civicrm_contribution_soft_soft_amount_count,
SUM({$this->_aliases['civicrm_contribution_soft']}.amount ) as civicrm_contribution_soft_soft_amount_sum,