CRM-18078 make receipt_date available to templates
authorEileen <eileen@fuzion.co.nz>
Mon, 22 Feb 2016 07:28:12 +0000 (20:28 +1300)
committereileenmcnaugton <eileen@fuzion.co.nz>
Mon, 22 Feb 2016 07:29:45 +0000 (20:29 +1300)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/Form/Task/PDF.php
CRM/Core/Payment/BaseIPN.php

index 5e630c3e09ab3c97a8aac7f69f91eb070500ae7e..c852a92965951c0957f332e72a83aef277d77c41 100644 (file)
@@ -2388,6 +2388,10 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
 
     //not really sure what params might be passed in but lets merge em into values
     $values = array_merge($this->_gatherMessageValues($input, $values, $ids), $values);
+    if (!empty($input['receipt_date'])) {
+      $values['receipt_date'] = $input['receipt_date'];
+    }
+
     $template = CRM_Core_Smarty::singleton();
     $this->_assignMessageVariablesToTemplate($values, $input, $template, $recur, $returnMessageText);
     //what does recur 'mean here - to do with payment processor return functionality but
@@ -4336,6 +4340,7 @@ WHERE eft.financial_trxn_id IN ({$trxnId}, {$baseTrxnId['financialTrxnId']})
       'is_test',
       'campaign_id',
       'receive_date',
+      'receipt_date',
     );
     if (self::isSingleLineItem($primaryContributionID)) {
       $inputContributionWhiteList[] = 'financial_type_id';
@@ -4602,6 +4607,7 @@ LIMIT 1;";
    */
   public static function sendMail(&$input, &$ids, $contribution, &$values, $recur = FALSE, $returnMessageText = FALSE) {
     $input['is_recur'] = $recur;
+    $input['receipt_date'] = $contribution->receipt_date;
     // set receipt from e-mail and name in value
     if (!$returnMessageText) {
       $session = CRM_Core_Session::singleton();
index 5bbe2a142e7bee2b7fff6dc10c201a57e3d131c3..e8ff34d45c26ae648cc295969824468428024a52 100644 (file)
@@ -166,6 +166,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
       'useForMember',
       'membership_assign',
       'amount',
+      'receipt_date',
     );
 
     foreach ($valuesRequiredForTemplate as $valueRequiredForTemplate) {
index 44db2609557de04e1af68b9532687ebf2d604178..480de6dfb55962943609599c4ea40176ff47cff8 100644 (file)
@@ -180,6 +180,7 @@ AND    {$this->_componentClause}";
       $input['net_amount'] = $contribution->net_amount;
       $input['trxn_id'] = $contribution->trxn_id;
       $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL;
+      $input['receipt_date'] = $contribution->receipt_date;
 
       // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
       $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);
index c44d43e8b87441fdf9cd41cd29595789e772e164..b47cd6872698206fcf381eceb2b0b09cef0c5a31 100644 (file)
@@ -121,6 +121,7 @@ class CRM_Core_Payment_BaseIPN {
       return FALSE;
     }
     $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
+    $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date);
 
     $objects['contact'] = &$contact;
     $objects['contribution'] = &$contribution;