From: Pradeep Nayak Date: Wed, 20 Jan 2016 21:34:09 +0000 (+0530) Subject: CRM-16259, round off of amount X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9b1d8402e1c3ca9d1d1068571876f42ce25ae667;p=civicrm-core.git CRM-16259, round off of amount ---------------------------------------- * CRM-16259: Create Payment API https://issues.civicrm.org/jira/browse/CRM-16259 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 363da16585..19ba606a2d 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4768,7 +4768,7 @@ LIMIT 1;"; foreach ($lineItems as $key => $value) { $paid = $value['line_total'] * ($contribution->net_amount / $contribution->total_amount); // Record Entity Financial Trxn - $params['amount'] = $paid; + $params['amount'] = round($paid, 2); $params['entity_id'] = $ftIds[$value['price_field_value_id']]; civicrm_api3('EntityFinancialTrxn', 'create', $params); @@ -4806,7 +4806,7 @@ LIMIT 1;"; foreach ($lineItems as $key => $value) { $paid = $value['line_total'] * ($params['total_amount'] / $contribution['total_amount']); // Record Entity Financial Trxn - $eftParams['amount'] = $paid; + $eftParams['amount'] = round($paid, 2); $eftParams['entity_id'] = $ftIds[$value['price_field_value_id']]; civicrm_api3('EntityFinancialTrxn', 'create', $eftParams);