From e8c64fab1a4515400bde9dcb5b194001a8fc9143 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 26 Dec 2014 17:07:55 +0530 Subject: [PATCH] CRM-15735 Update payment status for pay-later membership renewal ignores Received date --- CRM/Contribute/BAO/Contribution.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 8b08f86d71..70d0fa4f4e 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -1599,6 +1599,20 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ } } + // CRM-15735-to update the membership status as per the contribution receive date + if (!empty($params['receive_date'])) { + $status = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($membership->start_date, + $membership->end_date, + $membership->join_date, + $params['receive_date'], + FALSE, + $membership->membership_type_id, + (array) $membership + ); + $membership->status_id = CRM_Utils_Array::value('id', $status, $membership->status_id); + $membership->save(); + } + if ($currentMembership) { CRM_Member_BAO_Membership::fixMembershipStatusBeforeRenew($currentMembership, NULL); $dates = CRM_Member_BAO_MembershipType::getRenewalDatesForMembershipType($membership->id, NULL, NULL, $numterms); -- 2.25.1