Skip to content

Commit

Permalink
[REF] Clean up code around is_email_receipt
Browse files Browse the repository at this point in the history
The is_email_receipt param is passed into legacyProcessRecurringContribution
but not used. It is also used to set now to receipt date which is then
only used in a loop that uses a more direct method to check
if an email receipt is used.
  • Loading branch information
eileenmcnaughton committed Mar 6, 2021
1 parent 27dff1b commit aa16240
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 aa16240

Please sign in to comment.