Skip to content

Commit

Permalink
dev/mem#17 - Deleting memberships does not delete its related line item
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitendra Purohit committed Nov 15, 2019
1 parent a3628d0 commit 1f03543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Member/BAO/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ public static function deleteMembership($membershipId, $preserveContrib = FALSE)
CRM_Activity_BAO_Activity::deleteActivity($params);
}
self::deleteMembershipPayment($membershipId, $preserveContrib);
CRM_Price_BAO_LineItem::deleteLineItems($membershipId, 'civicrm_membership');

$results = $membership->delete();
$transaction->commit();
Expand Down Expand Up @@ -2263,7 +2264,7 @@ public static function updateAllMembershipStatus() {
self::processOverriddenUntilDateMembership($dao1);
}

$query = $baseQuery . " AND (civicrm_membership.is_override = 0 OR civicrm_membership.is_override IS NULL)
$query = $baseQuery . " AND (civicrm_membership.is_override = 0 OR civicrm_membership.is_override IS NULL)
AND civicrm_membership.status_id NOT IN (%1, %2, %3, %4)
AND civicrm_membership.owner_membership_id IS NULL ";
$params = [
Expand Down

0 comments on commit 1f03543

Please sign in to comment.