From: Pradeep Nayak Date: Wed, 24 Aug 2016 03:16:21 +0000 (+0530) Subject: CRM-16189 unset revenue recognition date when status <> pending X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e937b3761c8bfd098c711cb48ea56d836fabcb9a;p=civicrm-core.git CRM-16189 unset revenue recognition date when status <> pending ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index eff6ea3b0c..c4f44c0d1e 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -189,6 +189,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { // CRM-16189 CRM_Financial_BAO_FinancialAccount::checkFinancialTypeHasDeferred($params, $contributionID); if ($contributionID && !empty($params['revenue_recognition_date']) + && !($contributionStatus[$params['prevContribution']->contribution_status_id] == 'Pending') && !self::allowUpdateRevenueRecognitionDate($contributionID) ) { unset($params['revenue_recognition_date']);