CRM-15041 fix - View Event Registration / Change Selections : Total Paid and Balance...
authormonishdeb <monish.deb@webaccessglobal.com>
Fri, 1 Aug 2014 07:37:45 +0000 (13:07 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Fri, 1 Aug 2014 07:37:45 +0000 (13:07 +0530)
https://issues.civicrm.org/jira/browse/CRM-15041

CRM/Contribute/Form/Contribution.php

index 4063922d822e594c1b40df98d1e84f35b3e12f0d..6e1e785de970a0fb6c37e274b5f4ea1005abe47d 100644 (file)
@@ -952,7 +952,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     }
 
     $softErrors = CRM_Contribute_Form_SoftCredit::formRule($fields, $errors, $self);
-   
+
     // If we have a net amount or fee amount that is NOT set to 0.00, then ensure
     // that the net_amount + the fee_amount is equal to the total amount.
     $total_amount = NULL;
@@ -1217,9 +1217,13 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       }
 
       // Set is_pay_later flag for back-office offline Pending status contributions CRM-8996
+      // else if contribution_status is changed to Completed is_pay_later flag is changed to 0, CRM-15041
       if ($params['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Pending', 'name')) {
         $params['is_pay_later'] = 1;
       }
+      elseif ($params['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name')) {
+        $params['is_pay_later'] = 0;
+      }
 
       $ids['contribution'] = $params['id'] = $this->_id;
 
@@ -1715,4 +1719,3 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     }
   }
 }
-