From: pratikshad Date: Mon, 27 Apr 2015 09:18:44 +0000 (+0530) Subject: CRM-16304 fix-Incorrect FinancialTrxn dates for Backoffice Event Registration X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a975288882088881b2260d2ce2e1095c90754ee2;p=civicrm-core.git CRM-16304 fix-Incorrect FinancialTrxn dates for Backoffice Event Registration ---------------------------------------- * CRM-16304: Incorrect FinancialTrxn dates for Backoffice Event Registration https://issues.civicrm.org/jira/browse/CRM-16304 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 811b51d87b..127b17871f 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2725,7 +2725,7 @@ WHERE contribution_id = %1 "; $balanceTrxnParams['total_amount'] = $partialAmtTotal; $balanceTrxnParams['to_financial_account_id'] = $toFinancialAccount; $balanceTrxnParams['contribution_id'] = $params['contribution']->id; - $balanceTrxnParams['trxn_date'] = date('YmdHis'); + $balanceTrxnParams['trxn_date'] = !empty($params['contribution']->receipt_date) ? $params['contribution']->receipt_date : date('YmdHis'); $balanceTrxnParams['fee_amount'] = CRM_Utils_Array::value('fee_amount', $params); $balanceTrxnParams['net_amount'] = CRM_Utils_Array::value('net_amount', $params); $balanceTrxnParams['currency'] = $params['contribution']->currency; @@ -2778,7 +2778,7 @@ WHERE contribution_id = %1 "; $trxnParams = array( 'contribution_id' => $params['contribution']->id, 'to_financial_account_id' => $params['to_financial_account_id'], - 'trxn_date' => date('YmdHis'), + 'trxn_date' => !empty($params['contribution']->receipt_date) ? $params['contribution']->receipt_date : date('YmdHis'), 'total_amount' => $totalAmount, 'fee_amount' => CRM_Utils_Array::value('fee_amount', $params), 'net_amount' => CRM_Utils_Array::value('net_amount', $params, $totalAmount),