Skip to content

Commit

Permalink
Merge pull request #19746 from eileenmcnaughton/mem_2
Browse files Browse the repository at this point in the history
[REF] Clean up code around is_email_receipt
  • Loading branch information
seamuslee001 authored Mar 8, 2021
2 parents f00a026 + aa16240 commit 2fa1dfc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1842,21 +1842,13 @@ protected function processContribution(

// add these values for the recurringContrib function ,CRM-10188
$params['financial_type_id'] = $contributionParams['financial_type_id'];

$params['is_email_receipt'] = (bool) $this->getSubmittedValue('send_receipt');
$params['is_recur'] = TRUE;
$params['payment_instrument_id'] = $contributionParams['payment_instrument_id'] ?? NULL;
$recurringContributionID = $this->legacyProcessRecurringContribution($params, $contactID);

$now = CRM_Utils_Time::date('YmdHis');
$receiptDate = $params['receipt_date'] ?? NULL;
if ($params['is_email_receipt']) {
$receiptDate = $now;
}

if ($this->getSubmittedValue('send_receipt')) {
$contributionParams += [
'receipt_date' => $receiptDate,
'receipt_date' => CRM_Utils_Time::date('YmdHis'),
];
}

Expand Down

0 comments on commit 2fa1dfc

Please sign in to comment.