From 8233fa90b857809356b7ba7ea22728eea6786ee7 Mon Sep 17 00:00:00 2001 From: Edsel Date: Fri, 22 May 2015 18:03:09 +0530 Subject: [PATCH] ICM-1 Restricted membership types from being used when membership is being created --- CRM/Member/BAO/Membership.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 8fd061802b..0155ca046c 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1533,6 +1533,14 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id $allIDs = implode(',', $membershipTypeIDS); $whereClause .= " AND id IN ( $allIDs )"; } + CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, 'add'); + + if ($financialTypes) { + $whereClause .= " AND financial_type_id IN (" . implode(',' , array_keys($financialTypes)) . ")"; + } + else { + $whereClause .= " AND financial_type_id IN (0)"; + } $query = " SELECT * -- 2.25.1