don't send an extra receipt when completing pending contributions
authorJon Goldberg <jon@megaphonetech.com>
Mon, 5 Feb 2024 22:49:58 +0000 (17:49 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Mon, 5 Feb 2024 22:52:21 +0000 (17:52 -0500)
CRM/Contribute/Form/Contribution.php

index c63fbc46bba4e432fa8d43216bd8632f701a4737..2815e7933038f419c6ea78eb8d4bf8dcec937434 100644 (file)
@@ -2034,6 +2034,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
         && 'Completed' === CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $this->getSubmittedValue('contribution_status_id'))) {
         // @todo make users use add payment form.
         civicrm_api3('Payment', 'create', [
+          'is_send_contribution_notification' => FALSE,
           'contribution_id' => $this->getContributionID(),
           'total_amount' => $this->getContributionValue('balance_amount'),
           'currency' => $this->getSubmittedValue('currency'),
@@ -2048,6 +2049,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       $this->invoicingPostProcessHook($submittedValues, $action, $lineItem);
 
       //send receipt mail.
+      //FIXME: 'payment.create' could send a receipt.
       if ($contribution->id && !empty($formValues['is_email_receipt'])) {
         $formValues['contact_id'] = $this->_contactID;
         $formValues['contribution_id'] = $contribution->id;