From: Pradeep Nayak Date: Tue, 9 Aug 2016 11:51:28 +0000 (+0530) Subject: CRM-16189, freeze revenue recognition date if contribution is associated with partici... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cb8ce66bb02ee95c59ce10c159bf99216b138898;p=civicrm-core.git 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 --- 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