reporting-11 - fix Soft Credit report with full group by
authorJon Goldberg <jon@megaphonetech.com>
Fri, 22 Feb 2019 17:59:15 +0000 (12:59 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Fri, 22 Feb 2019 17:59:15 +0000 (12:59 -0500)
CRM/Report/Form/Contribute/SoftCredit.php

index 983d4795127b2eef9485bac4825566ada43257e7..5296451542ab974dfdd600746e1f42f849029fd2 100644 (file)
@@ -535,21 +535,10 @@ GROUP BY   {$this->_aliases['civicrm_contribution']}.currency
     $this->buildACLClause(array('constituentname', 'contact_civireport'));
     $sql = $this->buildQuery();
 
-    $dao = CRM_Core_DAO::executeQuery($sql);
     $rows = $graphRows = array();
-    $count = 0;
-    while ($dao->fetch()) {
-      $row = array();
-      foreach ($this->_columnHeaders as $key => $value) {
-        $row[$key] = $dao->$key;
-      }
-      $rows[] = $row;
-    }
-    $this->formatDisplay($rows);
+    $this->buildRows($sql, $rows);
 
-    // to hide the contact ID field from getting displayed
-    unset($this->_columnHeaders['civicrm_contact_id_constituent']);
-    unset($this->_columnHeaders['civicrm_contact_id_creditor']);
+    $this->formatDisplay($rows);
 
     // assign variables to templates
     $this->doTemplateAssignment($rows);