From 4bfcc0b809a700b4cfe972746012a0c1e48a86f8 Mon Sep 17 00:00:00 2001 From: Justin Freeman Date: Fri, 3 Jun 2022 17:13:41 +1000 Subject: [PATCH] PROJ-2290 Change scheduled job to only update membership end date for memberships with status: New, Current or Grace. 1.3.1 --- README.md | 2 +- api/v3/Membershiputils/Adjustmembershipenddate.php | 1 + info.xml | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3110b20..b4fbcb5 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ This feature is useful if you want to have all membership end dates occur on the This feature can be enabled or disabled on the `CiviCRM > Administer > Membership Utilities Settings` page, `/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fmembershiputils`. -If you have existing memberships that need to be updated, then execute the Scheduled Job, `Adjust Membership End Date`. This will also update the membership end date for all memberships, setting the end date to the end of month. +If you have existing memberships that need to be updated, then execute the Scheduled Job, `Adjust Membership End Date`. This will also update the membership end date for **New**, **Current** and **Grace** memberships, setting the end date to the end of month. # Installation diff --git a/api/v3/Membershiputils/Adjustmembershipenddate.php b/api/v3/Membershiputils/Adjustmembershipenddate.php index 9ff7f35..e8eef6a 100644 --- a/api/v3/Membershiputils/Adjustmembershipenddate.php +++ b/api/v3/Membershiputils/Adjustmembershipenddate.php @@ -34,6 +34,7 @@ function civicrm_api3_membershiputils_Adjustmembershipenddate($params) { // Get all memberships $memberships = Membership::get() ->addSelect('id', 'end_date') + ->addWhere('status_id:name', 'IN', ['New', 'Current', 'Grace']) ->execute()->getArrayCopy(); foreach ($memberships as $membership) { // Calculate the end of month date for the membership diff --git a/info.xml b/info.xml index d8a9f24..dfc6364 100644 --- a/info.xml +++ b/info.xml @@ -14,8 +14,8 @@ https://agileware.com.au/contact http://www.gnu.org/licenses/agpl-3.0.html - 2022-05-31 - 1.3 + 2022-06-03 + 1.3.1 beta 5.0