From 3b4133752bb616d4fbbe22329b99d9acd617a2cd Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 29 Jul 2015 12:32:30 +0530 Subject: [PATCH] CRM-16792 - Report: Contrib Summary when soft credit stats and filter applied --- CRM/Report/Form/Contribute/Summary.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index 93d43faad8..53a962b8b0 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -565,12 +565,13 @@ ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as civicrm if ($softCredit) { $this->from(); - $softSQL = "SELECT + $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, -ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_contribution_soft_soft_amount_avg, -{$this->_aliases['civicrm_contribution']}.currency as currency -{$this->_from} {$this->_where} {$group} {$this->_having}"; +ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_contribution_soft_soft_amount_avg"; + $contriQuery = "{$select}, {$contriQuery}"; + $softSQL = "SELECT {$select}, {$this->_aliases['civicrm_contribution']}.currency as currency + {$this->_from} {$this->_where} {$group} {$this->_having}"; } $contriSQL = "SELECT {$contriQuery} {$group} {$this->_having}"; -- 2.25.1