From: Wahyu Kodar Date: Thu, 15 Sep 2016 04:14:33 +0000 (+0700) Subject: fix net amount api explore X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b001aaef7e0446fe0354c8875769a4b117081c4f;p=civicrm-core.git fix net amount api explore --- 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'); }