Skip to content

Commit

Permalink
--CRM-20585, fixed financial trxn entry for deferred revenue
Browse files Browse the repository at this point in the history
CRM-20585, fixed jenkins style

----------------------------------------
* CRM-20585: Correct the from and to accounts for deferred revenue transactions
  https://issues.civicrm.org/jira/browse/CRM-20585
  • Loading branch information
pradpnayak committed May 17, 2017
1 parent 87bf7cb commit 090a3ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/BAO/FinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,10 @@ public static function createDeferredTrxn($lineItems, $contributionDetails, $upd
}
foreach ($results['values'] as $result) {
if ($result['account_relationship'] == $accountRel) {
$trxnParams['to_financial_account_id'] = $result['financial_account_id'];
$trxnParams['from_financial_account_id'] = $result['financial_account_id'];
}
else {
$trxnParams['from_financial_account_id'] = $result['financial_account_id'];
$trxnParams['to_financial_account_id'] = $result['financial_account_id'];
}
}
foreach ($deferredRevenue['revenue'] as $revenue) {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Contribute/BAO/ContributionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ public function testContributionWithDeferredRevenue() {
$checkAgainst = array(
'financial_trxn_id.to_financial_account_id.name' => 'Deferred Revenue - Event Fee',
'financial_trxn_id.from_financial_account_id.name' => 'Event Fee',
'financial_trxn_id' => '2'
'financial_trxn_id' => '2',
);
$result = $this->callAPISuccessGetSingle('EntityFinancialTrxn', array(
'return' => array(
Expand Down

0 comments on commit 090a3ab

Please sign in to comment.