From 0024715fbb51427be628423ce55e7ab9aeb8e913 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Tue, 21 Jan 2014 21:33:21 +0530 Subject: [PATCH] CRM-13973 : corrected the to_financial_account_id vals while selection changes --- CRM/Event/BAO/Participant.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index 9b6d28d180..c3166402c0 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1861,11 +1861,13 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI CRM_Contribute_BAO_Contribution::getValues(array('id' => $contributionId), CRM_Core_DAO::$_nullArray, CRM_Core_DAO::$_nullArray); $prevTrxnId = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($contributionId); $fetchPrevTrxn['id'] = $prevTrxnId['financialTrxnId']; - $prevTrxnToFinancialId = CRM_Core_DAO::getFieldValue('CRM_Core_BAO_FinancialTrxn', $prevTrxnId['financialTrxnId'], 'to_financial_account_id'); + + $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' ")); + $toFinancialAccount = CRM_Contribute_PseudoConstant::financialAccountType($updatedContribution->financial_type_id, $relationTypeId); $adjustedTrxnValues = array( 'from_financial_account_id' => NULL, - 'to_financial_account_id' => $prevTrxnToFinancialId, + 'to_financial_account_id' => $toFinancialAccount, 'trxn_date' => date('YmdHis'), 'total_amount' => $balanceAmt, 'currency' => $updatedContribution->currency, -- 2.25.1