*/
public function processMembership($contactID, $membershipTypeID, $is_test, $changeToday, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $isPayLater) {
$allStatus = CRM_Member_PseudoConstant::membershipStatus();
- $membershipTypeDetails = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($membershipTypeID);
$ids = [];
// CRM-7297 - allow membership type to be be changed during renewal so long as the parent org of new membershipType
'end_date' => $currentMembership['end_date'],
'join_date' => $currentMembership['join_date'],
'membership_type_id' => $membershipTypeID,
- 'max_related' => !empty($membershipTypeDetails['max_related']) ? $membershipTypeDetails['max_related'] : NULL,
'membership_activity_status' => ($pending || $isPayLater) ? 'Scheduled' : 'Completed',
];
if ($contributionRecurID) {
'relationship_type_id' => 20,
'min_fee' => 100,
'financial_type_id' => $this->financialTypeID,
+ 'max_related' => 10,
])['id'];
$this->_membershipID = $this->callAPISuccess('Membership', 'create', [
// This format reflects the 23 being the organisation & the 25 being the type.
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '0',
- 'max_related' => '',
'num_terms' => '1',
'source' => '',
'total_amount' => '50.00',
// This format reflects the 23 being the organisation & the 25 being the type.
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '0',
- 'max_related' => '',
'num_terms' => '1',
'source' => '',
'total_amount' => '50.00',
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '1',
'is_recur' => 1,
- 'max_related' => 0,
'num_terms' => '1',
'source' => '',
'total_amount' => '77.00',
// This format reflects the 23 being the organisation & the 25 being the type.
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '0',
- 'max_related' => '',
'num_terms' => '2',
'total_amount' => '50.00',
//Member dues, see data.xml
// This format reflects the 23 being the organisation & the 25 being the type.
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '0',
- 'max_related' => '',
'num_terms' => '2',
'total_amount' => '50.00',
//Member dues, see data.xml
'trxn_id' => 777,
'contribution_status_id' => 2,
'billing_first_name' => 'Test',
- 'billing_middlename' => 'Last',
+ 'billing_middle_name' => 'Last',
'billing_street_address-5' => '10 Test St',
'billing_city-5' => 'Test',
'billing_state_province_id-5' => '1003',
$form->testSubmit($params);
$membership = $this->callAPISuccessGetSingle('Membership', ['contact_id' => $this->_individualId]);
$this->assertEquals(strtotime($membership['end_date']), strtotime($originalMembership['end_date']));
+ $this->assertEquals(10, $membership['max_related']);
+
$contribution = $this->callAPISuccessGetSingle('Contribution', [
'contact_id' => $this->_individualId,
'contribution_status_id' => 2,
// This format reflects the 23 being the organisation & the 25 being the type.
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '0',
- 'max_related' => '',
'num_terms' => '2',
'total_amount' => '50.00',
//Member dues, see data.xml
'membership_type_id' => [23, $this->membershipTypeAnnualFixedID],
'auto_renew' => '1',
'is_recur' => 1,
- 'max_related' => 0,
'num_terms' => '1',
'total_amount' => $this->formatMoneyInput('7800.90'),
//Member dues, see data.xml