dev/core#2009 filter grant dashboard to exclude trashed contacts
authorBrian Shaughnessy <brian@lcdservices.biz>
Thu, 10 Sep 2020 19:10:09 +0000 (15:10 -0400)
committerBrian Shaughnessy <brian@lcdservices.biz>
Thu, 10 Sep 2020 19:10:09 +0000 (15:10 -0400)
CRM/Grant/BAO/Grant.php

index d38aeb5c41b418a384ce37a5452e899516c12e05..e203d546f5585b0b371fe3a7441603de8d5eb630 100644 (file)
@@ -25,8 +25,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
    */
   public static function getGrantSummary($admin = FALSE) {
     $query = "
-            SELECT status_id, count(id) as status_total
-            FROM civicrm_grant  GROUP BY status_id";
+      SELECT status_id, count(g.id) as status_total
+      FROM civicrm_grant g
+      JOIN civicrm_contact c
+        ON g.contact_id = c.id
+      WHERE c.is_deleted = 0
+      GROUP BY status_id
+    ";
 
     $dao = CRM_Core_DAO::executeQuery($query);