$isProcessSeparateMembershipTransaction = $this->isSeparateMembershipTransaction($this->_id, $this->_values['amount_block_is_active']);
if ($this->_values['amount_block_is_active']) {
- $contributionTypeId = $this->_values['financial_type_id'];
+ $financialTypeID = $this->_values['financial_type_id'];
}
else {
- $contributionTypeId = CRM_Utils_Array::value('financial_type_id', $membershipType, CRM_Utils_Array::value('financial_type_id', $membershipParams));
+ $financialTypeID = CRM_Utils_Array::value('financial_type_id', $membershipType, CRM_Utils_Array::value('financial_type_id', $membershipParams));
+ }
+
+ if (CRM_Utils_Array::value('membership_source', $this->_params)) {
+ $membershipParams['contribution_source'] = $this->_params['membership_source'];
}
CRM_Member_BAO_Membership::postProcessMembership($membershipParams, $contactID,
- $this, $premiumParams, $customFieldsFormatted, $fieldTypes, $membershipType, $membershipTypeIDs, $isPaidMembership, $this->_membershipId, $isProcessSeparateMembershipTransaction, $contributionTypeId,
+ $this, $premiumParams, $customFieldsFormatted, $fieldTypes, $membershipType, $membershipTypeIDs, $isPaidMembership, $this->_membershipId, $isProcessSeparateMembershipTransaction, $financialTypeID,
$membershipLineItems, $isPayLater, $isPending);
+
$this->assign('membership_assign', TRUE);
$this->set('membershipTypeID', $membershipParams['selectMembership']);
}
*
* @param bool $isProcessSeparateMembershipTransaction
*
- * @param int $defaultContributionTypeID
+ * @param int $financialTypeID
* @param array $membershipLineItems
* Line items specific to membership payment that is separate to contribution.
* @param bool $isPayLater
public static function postProcessMembership(
$membershipParams, $contactID, &$form, $premiumParams,
$customFieldsFormatted = NULL, $includeFieldTypes = NULL, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID,
- $isProcessSeparateMembershipTransaction, $defaultContributionTypeID, $membershipLineItems, $isPayLater, $isPending) {
+ $isProcessSeparateMembershipTransaction, $financialTypeID, $membershipLineItems, $isPayLater, $isPending) {
$result = $membershipContribution = NULL;
$isTest = CRM_Utils_Array::value('is_test', $membershipParams, FALSE);
$errors = $createdMemberships = $paymentResult = array();
- //@todo move this into the calling function & pass in the correct financialTypeID
- if (isset($paymentParams['financial_type'])) {
- $financialTypeID = $paymentParams['financial_type'];
- }
- else {
- $financialTypeID = $defaultContributionTypeID;
- }
-
- if (CRM_Utils_Array::value('membership_source', $form->_params)) {
- $membershipParams['contribution_source'] = $form->_params['membership_source'];
- }
-
if ($isPaidMembership) {
if ($isProcessSeparateMembershipTransaction) {
// If we have 2 transactions only one can use the invoice id.
public static function processSecondaryFinancialTransaction($contactID, &$form, $tempParams, $isTest, $lineItems, $minimumFee, $financialTypeID) {
$financialType = new CRM_Financial_DAO_FinancialType();
$financialType->id = $financialTypeID;
- if (!$financialType->find(TRUE)) {
- CRM_Core_Error::fatal(ts("Could not find a system table"));
- }
+ $financialType->find(TRUE);
$tempParams['amount'] = $minimumFee;
$tempParams['invoiceID'] = md5(uniqid(rand(), TRUE));