From d07d3140b9606d3e845e67ffc83b4d31229d192c Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 13 Jun 2016 15:29:06 +0530 Subject: [PATCH] CRM-17684: check where end date is past to determine auto-renew subscription has ended ---------------------------------------- * CRM-17684: Find Memberships with no auto-renew https://issues.civicrm.org/jira/browse/CRM-17684 --- CRM/Member/BAO/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index b1b2ec27df..dda4410cc9 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -307,7 +307,7 @@ class CRM_Member_BAO_Query { } elseif ($value == 5) { $query->_where[$grouping][] = " civicrm_membership.contribution_recur_id IS NOT NULL"; - $query->_where[$grouping][] = " ccr.end_date IS NOT NULL"; + $query->_where[$grouping][] = " ccr.end_date IS NOT NULL AND ccr.end_date < NOW()"; $query->_qill[$grouping][] = ts("Membership is Auto-Renew and Ended"); } $query->_tables['civicrm_membership'] = $query->_whereTables['civicrm_membership'] = 1; @@ -423,7 +423,7 @@ class CRM_Member_BAO_Query { 'membership_recur_id' => 1, 'member_campaign_id' => 1, 'member_is_override' => 1, - 'member_auto_renew' => '1', + 'member_auto_renew' => 1, ); if ($includeCustomFields) { -- 2.25.1