From: Klaas Eikelboom Date: Thu, 16 Nov 2017 16:38:19 +0000 (+0000) Subject: CRM-21424 Set receipt date when downloading pdf receipt X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2439fa7b8947b9ce65ac27bcf613fbcc16e9aaa7;p=civicrm-core.git CRM-21424 Set receipt date when downloading pdf receipt --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 0be55b010c..08c2168158 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4722,7 +4722,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']}) $values['contribution_status'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contribution->contribution_status_id); $return = $contribution->composeMessageArray($input, $ids, $values, $returnMessageText); // Contribution ID should really always be set. But ? - if (!$returnMessageText && (!isset($input['receipt_update']) || $input['receipt_update']) && empty($contribution->receipt_date)) { + if ((!isset($input['receipt_update']) || $input['receipt_update']) && empty($contribution->receipt_date)) { civicrm_api3('Contribution', 'create', array('receipt_date' => 'now', 'id' => $contribution->id)); } return $return;