--fixed net amount field during update of contribution amount
[civicrm-core.git] / CRM / Contribute / BAO / Contribution.php
index 55db953b939504ec4e9ce14b6485064b26ff82df..ffb02e8458bd00c19d4fc64278e14754ca7775ad 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
@@ -3138,7 +3138,7 @@ WHERE  contribution_id = %1 ";
       return;
     }
     if ($context == 'changedAmount' || $context == 'changeFinancialType') {
-      $itemAmount = $params['trxnParams']['total_amount'] = $params['total_amount'] - $params['prevContribution']->total_amount;
+      $itemAmount = $params['trxnParams']['total_amount'] = $params['trxnParams']['net_amount'] = $params['total_amount'] - $params['prevContribution']->total_amount;
     }
     if ($context == 'changedStatus') {
       //get all the statuses