From: monishdeb <monish.deb@webaccessglobal.com> Date: Tue, 9 Sep 2014 12:11:06 +0000 (+0530) Subject: CRM-15232 fix - LIne items are missing from receipts when using a price set with... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=12dac86663671e045956d989733ebecbba985a2d;p=civicrm-core.git CRM-15232 fix - LIne items are missing from receipts when using a price set with multiple membership organization price fields https://issues.civicrm.org/jira/browse/CRM-15232 --- diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index 9d1db36d66..da921d378e 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -314,7 +314,6 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio 'displayName' => $displayName, 'contributionID' => CRM_Utils_Array::value('contribution_id', $values), 'contributionOtherID' => CRM_Utils_Array::value('contribution_other_id', $values), - 'membershipID' => CRM_Utils_Array::value('membership_id', $values), // CRM-5095 'lineItem' => CRM_Utils_Array::value('lineItem', $values), // CRM-5095 @@ -370,8 +369,8 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio // use either the contribution or membership receipt, based on whether itâs a membership-related contrib or not $sendTemplateParams = array( - 'groupName' => $tplParams['membershipID'] ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution', - 'valueName' => $tplParams['membershipID'] ? 'membership_online_receipt' : 'contribution_online_receipt', + 'groupName' => !empty($values['isMembership']) ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution', + 'valueName' => !empty($values['isMembership']) ? 'membership_online_receipt' : 'contribution_online_receipt', 'contactId' => $contactID, 'tplParams' => $tplParams, 'isTest' => $isTest, diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 3ce24572f0..70402db2f8 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1359,9 +1359,14 @@ AND civicrm_membership.is_test = %2"; } if(count($createdMemberships) == 1) { //presumably this is only relevant for exactly 1 membership - $form->_params['membershipID'] = $form->_values['membership_id'] = $createdMembership->id; + $form->_params['membershipID'] = $createdMembership->id; } + //CRM-15232: Check if membership is created and on the basis of it use + //membership reciept template to send payment reciept + if (count($createdMemberships)) { + $form->_values['isMembership'] = TRUE; + } if ($form->_contributeMode == 'notify') { if ($form->_values['is_monetary'] && $form->_amount > 0.0 && !$form->_params['is_pay_later']) { // call postProcess hook before leaving