Skip to content

Commit

Permalink
Merge pull request civicrm#15 from Edzelopez/CIVI-28
Browse files Browse the repository at this point in the history
CIVI-28 Added WhereClause for Summary and Detail contribution reports
  • Loading branch information
Edzelopez committed Mar 19, 2015
2 parents cad2f4e + a847179 commit 523e9b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Contribute/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ public static function whereClauseSingle(&$values, &$query) {
return;

case 'financial_type_id':
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes);
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.$name", 'IN', array_keys($financialTypes), 'String');
case 'contribution_page_id':
case 'contribution_status_id':
case 'contribution_id':
Expand Down Expand Up @@ -545,6 +547,8 @@ public static function whereClauseSingle(&$values, &$query) {
default:
//all other elements are handle in this case
$fldName = substr($name, 13);
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes);
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_contribution.financial_type_id", 'IN', array_keys($financialTypes), 'String');
if (!isset($fields[$fldName])) {
// CRM-12597
CRM_Core_Session::setStatus(ts(
Expand Down

0 comments on commit 523e9b0

Please sign in to comment.