From b001aaef7e0446fe0354c8875769a4b117081c4f Mon Sep 17 00:00:00 2001 From: Wahyu Kodar Date: Thu, 15 Sep 2016 11:14:33 +0700 Subject: [PATCH] fix net amount api explore --- CRM/Contribute/BAO/Contribution.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e909d436ed..581932eb8d 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3462,6 +3462,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $itemAmount = $params['trxnParams']['total_amount'] + $cancelledTaxAmount; } elseif ($context == 'changePaymentInstrument') { + $params['trxnParams']['net_amount'] = $params['trxnParams']['total_amount']; $deferredFinancialAccount = CRM_Utils_Array::value('deferred_financial_account_id', $params); if (empty($deferredFinancialAccount)) { $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Deferred Revenue Account is' ")); @@ -3482,7 +3483,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac } else { if ($params['total_amount'] < 0) { - $params['trxnParams']['net_amount'] = $params['trxnParams']['total_amount']; $params['trxnParams']['payment_instrument_id'] = $params['prevContribution']->payment_instrument_id; $params['trxnParams']['to_financial_account_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $lastFinancialTrxnId['financialTrxnId'], 'to_financial_account_id'); } -- 2.25.1