CRM-13973-comment : handled 'Refunded' status logic during Status edit of a contribution
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 10 Apr 2014 13:24:22 +0000 (18:54 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 10 Apr 2014 13:24:22 +0000 (18:54 +0530)
CRM/Contribute/BAO/Contribution.php

index 7c8607942a44dee16127e2ed34c17e2868e87c1f..a98ca8d477cd48c7b3be4749ad039ff850f89645 100644 (file)
@@ -2866,7 +2866,8 @@ WHERE  contribution_id = %1 ";
           }
           else {
             $diff = 1;
-            if ($context == 'changeFinancialType' || $params['contribution']->contribution_status_id == array_search('Cancelled', $contributionStatus)) {
+            if ($context == 'changeFinancialType' || $params['contribution']->contribution_status_id == array_search('Cancelled', $contributionStatus)
+              || $params['contribution']->contribution_status_id == array_search('Refunded', $contributionStatus)) {
              $diff = -1;
             }
             $amount = $diff * $fieldValues['line_total'];