From cb8ce66bb02ee95c59ce10c159bf99216b138898 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 9 Aug 2016 17:21:28 +0530 Subject: [PATCH] CRM-16189, freeze revenue recognition date if contribution is associated with participant and only membership ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 --- CRM/Contribute/Form/Contribution.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 10f86a29ad..97b24e9ac8 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -751,7 +751,10 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP // CRM-16189, add Revenue Recognition Date if (CRM_Contribute_BAO_Contribution::checkContributeSettings('deferred_revenue_enabled')) { - $this->add('date', 'revenue_recognition_date', ts('Revenue Recognition Date'), CRM_Core_SelectValues::date(NULL, 'M Y', NULL, 5)); + $revenueDate = $this->add('date', 'revenue_recognition_date', ts('Revenue Recognition Date'), CRM_Core_SelectValues::date(NULL, 'M Y', NULL, 5)); + if ($this->_id && !CRM_Contribute_BAO_Contribution::allowUpdateRevenueRecognitionDate($this->_id)) { + $revenueDate->freeze(); + } } // add various dates -- 2.25.1