From 3413424deef4cf72219f0098619b353a4b5fe2ec Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 8 Aug 2015 01:52:59 +0530 Subject: [PATCH] --CRM-16526, fixed sql syntax on find contribution --- CRM/Contact/BAO/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 944abf5cf1..116316ac68 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4761,11 +4761,11 @@ SELECT COUNT( conts.total_amount ) as total_count, $summary = array(); $summary['total'] = array(); $summary['total']['count'] = $summary['total']['amount'] = $summary['total']['avg'] = "n/a"; - $innerQuery = "SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count, - civicrm_contribution.currency $from $completedWhere"; $from .= " LEFT JOIN civicrm_line_item li ON civicrm_contribution.id = li.contribution_id AND li.entity_table = 'civicrm_contribution' AND li.financial_type_id NOT IN (" . implode(',', array_keys($financialTypes)) . ") "; + $innerQuery = "SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count, + civicrm_contribution.currency $from $completedWhere"; $query = "$select FROM ( $innerQuery GROUP BY civicrm_contribution.id ) as conts -- 2.25.1