CRM-20966: Do not create membership_payment record for inherited membership.
authorDave Jenkins <davej+git@circle-interactive.co.uk>
Tue, 25 Jul 2017 15:49:13 +0000 (16:49 +0100)
committerDave Jenkins <davej+git@circle-interactive.co.uk>
Tue, 25 Jul 2017 15:49:13 +0000 (16:49 +0100)
CRM/Member/BAO/Membership.php

index 6d206aa137b10365629e19600d18df5dc846214a..4f3528908c8be00f63d0c38cceebf888ac91dff0 100644 (file)
@@ -1478,6 +1478,9 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
         unset($params['lineItems']);
         unset($params['line_item']);
 
+        // CRM-20966: Do not create membership_payment record for inherited membership.
+        unset($params['relate_contribution_id']);
+
         if (($params['status_id'] == $deceasedStatusId) || ($params['status_id'] == $expiredStatusId)) {
           // related membership is not active so does not count towards maximum
           CRM_Member_BAO_Membership::create($params, $relMemIds);