Receive date is missing when contribution with pay later.CRM-16317
authorjagrutiP <jagruti.phadale@webaccessglobal.com>
Mon, 20 Apr 2015 10:07:45 +0000 (15:37 +0530)
committerjagrutiP <jagruti.phadale@webaccessglobal.com>
Mon, 20 Apr 2015 10:07:45 +0000 (15:37 +0530)
----------------------------------------
* CRM-16317: Receive date is missing when contribution with pay later
  https://issues.civicrm.org/jira/browse/CRM-16317

CRM/Contribute/BAO/Contribution/Utils.php

index 2f5772729eb1eb430e1bcd10763495e7ceddc0ec..b487eda352b826133b0a9116a0507296a7472046 100644 (file)
@@ -98,8 +98,12 @@ class CRM_Contribute_BAO_Contribution_Utils {
     }
 
     //fix for CRM-2062
-    $now = date('YmdHis');
+    //fix for CRM-16317
 
+    $now = $form->_params['receive_date'] = date('YmdHis');
+    $form->assign('receive_date',
+      CRM_Utils_Date::mysqlToIso($form->_params['receive_date'])
+    );
     $result = NULL;
     if ($form->_contributeMode == 'notify' ||
       $isPayLater
@@ -125,7 +129,6 @@ class CRM_Contribute_BAO_Contribution_Utils {
 
       $form->_params['contributionTypeID'] = $contributionTypeId;
       $form->_params['item_name'] = $form->_params['description'];
-      $form->_params['receive_date'] = $now;
 
       if ($contribution && $form->_values['is_recur'] &&
         $contribution->contribution_recur_id
@@ -290,12 +293,8 @@ class CRM_Contribute_BAO_Contribution_Utils {
       if ($result) {
         $form->_params = array_merge($form->_params, $result);
       }
-      $form->_params['receive_date'] = $now;
       $form->set('params', $form->_params);
       $form->assign('trxn_id', CRM_Utils_Array::value('trxn_id', $result));
-      $form->assign('receive_date',
-        CRM_Utils_Date::mysqlToIso($form->_params['receive_date'])
-      );
 
       // result has all the stuff we need
       // lets archive it to a financial transaction