Skip to content
Snippets Groups Projects
Commit 83a30437 authored by Seamus Lee's avatar Seamus Lee
Browse files

#1776 Ensure that all fee financial item transaction date is set to...

#1776 Ensure that all fee financial item transaction date is set to the recieve date of the contribution
parent ca5fb3d1
No related branches found
No related tags found
No related merge requests found
......@@ -417,7 +417,7 @@ WHERE ceft.entity_id = %1";
'financial_account_id' => $financialAccount,
'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id'),
'created_date' => date('YmdHis'),
'transaction_date' => date('YmdHis'),
'transaction_date' => $params['trxnParams']['trxn_date'],
'amount' => $amount,
'description' => 'Fee',
'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Financial_BAO_FinancialItem', 'status_id', 'Paid'),
......
......@@ -518,6 +518,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
];
$contribution = $this->callAPISuccess('contribution', 'create', $params);
$financialItems = $this->callAPISuccess('FinancialItem', 'get', []);
foreach ($financialItems['values'] as $financialItem) {
$this->assertEquals(date('Y-m-d H:i:s', strtotime($contribution['values'][$contribution['id']]['receive_date'])), date('Y-m-d H:i:s', strtotime($financialItem['transaction_date'])));
}
$lineItems = $this->callAPISuccess('line_item', 'get', [
'entity_id' => $contribution['id'],
'entity_table' => 'civicrm_contribution',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment