}
// CRM-15735-to update the membership status as per the contribution receive date
+ $joinDate = NULL;
if (!empty($params['receive_date'])) {
+ $joinDate = $params['receive_date'];
$status = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($membership->start_date,
$membership->end_date,
$membership->join_date,
$dates['join_date'] = CRM_Utils_Date::customFormat($currentMembership['join_date'], $format);
}
else {
- $dates = CRM_Member_BAO_MembershipType::getDatesForMembershipType($membership->membership_type_id, NULL, NULL, NULL, $numterms);
+ $dates = CRM_Member_BAO_MembershipType::getDatesForMembershipType($membership->membership_type_id, $joinDate, NULL, NULL, $numterms);
}
//get the status for membership.
*
* @return null|string
*/
- protected function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL) {
+ protected function updateRelatedComponent($contributionId, $statusId, $previousStatusId = NULL, $receiveDate = NULL) {
$statusMsg = NULL;
if (!$contributionId || !$statusId) {
return $statusMsg;
'contribution_id' => $contributionId,
'contribution_status_id' => $statusId,
'previous_contribution_status_id' => $previousStatusId,
+ 'receive_date' => $receiveDate,
);
$updateResult = CRM_Contribute_BAO_Contribution::transitionComponents($params);
$contribution->contribution_status_id,
CRM_Utils_Array::value('contribution_status_id',
$this->_values
- )
+ ),
+ $contribution->receive_date
);
}