From 5f6d46e1e9156339a28c79695dfa936de662e3ef Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 1 Aug 2014 13:07:45 +0530 Subject: [PATCH] CRM-15041 fix - View Event Registration / Change Selections : Total Paid and Balance are incorrect after a contribution is recorded for Pay-later registrations https://issues.civicrm.org/jira/browse/CRM-15041 --- CRM/Contribute/Form/Contribution.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 4063922d82..6e1e785de9 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -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 } } } - -- 2.25.1