From e9ec41198a1b5457ee9f0a74d1211e8c3b559df2 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 15 Jul 2015 15:32:15 +0530 Subject: [PATCH] minor fix for median calculation CRM-16714 & CRM-16715 --- CRM/Contribute/BAO/Contribution.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 534b387ced..d2ad4c6e37 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3878,9 +3878,9 @@ WHERE con.id = {$contributionId} return $mode; case 'median': - $midValue = 0; $currencies = CRM_Core_OptionGroup::values('currencies_enabled'); foreach ($currencies as $currency => $val) { + $midValue = 0; $where = "AND {$alias}.currency = '{$currency}'"; $rowCount = CRM_Core_DAO::singleValueQuery("SELECT count(*) as count {$sql} {$where}"); -- 2.25.1