Minor fixes for CRM-16636
authorWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 16 Jun 2015 05:07:39 +0000 (10:37 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 16 Jun 2015 05:07:39 +0000 (10:37 +0530)
CRM/Report/Form/Member/ContributionDetail.php

index 965da7783c826e91c8919d2bf0ac47bd7c60ca1c..79ee62c845bac935a955f799ed07fb3485d45143 100644 (file)
@@ -612,11 +612,9 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form {
 
     $select = "SELECT DISTINCT {$this->_aliases['civicrm_contribution']}.id";
 
-    $group = "\nGROUP BY cc.currency";
-
-    $sql = "SELECT COUNT(cc.id) as count, SUM( cc.total_amount ) as amount, ROUND(AVG(cc.total_amount), 2) as avg, cc.currency as currency
+    $sql = "SELECT COUNT(cc.id) as count, SUM(cc.total_amount) as amount, ROUND(AVG(cc.total_amount), 2) as avg, cc.currency as currency
             FROM civicrm_contribution cc
-            WHERE cc.id IN ({$select} {$this->_from} {$this->_where}) {$group}";
+            WHERE cc.id IN ({$select} {$this->_from} {$this->_where}) GROUP BY cc.currency";
 
     $dao = CRM_Core_DAO::executeQuery($sql);
     $totalAmount = $average = array();