CRM-16259, round off of amount
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jan 2016 21:34:09 +0000 (03:04 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jan 2016 21:34:09 +0000 (03:04 +0530)
----------------------------------------
* CRM-16259: Create Payment API
  https://issues.civicrm.org/jira/browse/CRM-16259

CRM/Contribute/BAO/Contribution.php

index 363da165855f06a731b7f5d4e1c39b457485e91f..19ba606a2d8e5f6e5b3e2ae041631c34ae146905 100644 (file)
@@ -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);