From 70fe72324318c7342c1c21df5c5f87dfe2757ef3 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 7 Sep 2020 06:37:25 +1000 Subject: [PATCH] [REF] Mark CRM_Contribute_BAO_Contribution_Utils::formatAmount deprecated and replace its only usage with CRM_Utils_Rule::cleanMoney --- CRM/Contribute/BAO/Contribution.php | 2 +- CRM/Contribute/BAO/Contribution/Utils.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index a20a62853f..042152c1c2 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -5492,7 +5492,7 @@ LIMIT 1;"; $paid = $entityParams['line_item_amount'] * ($entityParams['trxn_total_amount'] / $entityParams['contribution_total_amount']); } // Record Entity Financial Trxn; CRM-20145 - $eftParams['amount'] = CRM_Contribute_BAO_Contribution_Utils::formatAmount($paid); + $eftParams['amount'] = $paid; civicrm_api3('EntityFinancialTrxn', 'create', $eftParams); } diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 21fd4716d4..683b92c6a6 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -496,6 +496,7 @@ LIMIT 1 * Amount rounded and returned with the desired decimal places */ public static function formatAmount($amount, $decimals = 2) { + CRM_Core_Error::deprecatedFunctionWarning('Use CRM_Utils_Rule::cleanMoney instead'); return number_format((float) round($amount, (int) $decimals), (int) $decimals, '.', ''); } -- 2.25.1