CRM-21424 Set receipt date when downloading pdf receipt
authorKlaas Eikelboom <klaas.eikelboom@civicoop.org>
Thu, 16 Nov 2017 16:38:19 +0000 (16:38 +0000)
committerKlaas Eikelboom <klaas.eikelboom@civicoop.org>
Thu, 16 Nov 2017 16:38:19 +0000 (16:38 +0000)
CRM/Contribute/BAO/Contribution.php

index 0be55b010c53645047f4ad775d32fbad4fe16726..08c216815823967426efa7d1ed50a3bcd49e7658 100644 (file)
@@ -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;