Merge pull request #11622 from omarabuhussein/CRM-21733-membership-override-improvments
authorEileen McNaughton <eileen@mcnaughty.com>
Wed, 14 Feb 2018 20:40:21 +0000 (09:40 +1300)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2018 20:40:21 +0000 (09:40 +1300)
CRM-21733: Adding the ability to override membership until specific date

1  2 
CRM/Contribute/BAO/Contribution.php
CRM/Member/BAO/Membership.php
tests/phpunit/CRM/Member/Form/MembershipTest.php

Simple merge
index 00361ca217c6d4767e14cc15c961cc4e9c68efce,6b6ff60f5d66e528c0c5228817aebde967d7064c..4e8c079c4d8899e54237a14c967f0e3355d26dcc
@@@ -2234,16 -2183,17 +2234,17 @@@ INNER JOIN  civicrm_contact contact ON 
     * @return array
     */
    public static function updateAllMembershipStatus() {
 +    // Tests for this function are in api_v3_JobTest. Please add tests for all updates.
 +
 +    $updateCount = $processCount = self::updateDeceasedMembersStatuses();
  
 -    //get all active statuses of membership, CRM-3984
 -    $allStatus = CRM_Member_PseudoConstant::membershipStatus();
 -    $statusLabels = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label');
      $allTypes = CRM_Member_PseudoConstant::membershipType();
  
 -    // get only memberships with active membership types
 -    $query = "
 +    // This query retrieves ALL memberships of active types.
 +    $baseQuery = "
  SELECT     civicrm_membership.id                    as membership_id,
             civicrm_membership.is_override           as is_override,
+            civicrm_membership.status_override_end_date  as status_override_end_date,
             civicrm_membership.membership_type_id    as membership_type_id,
             civicrm_membership.status_id             as status_id,
             civicrm_membership.join_date             as join_date,