From 1a55f42e2b2244adbb5430524a5e6149760eb782 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 9 Aug 2016 17:21:44 +0530 Subject: [PATCH] CRM-16189, unset revenue recognition date from $params 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/BAO/Contribution.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index a8223d8089..eff6ea3b0c 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -188,6 +188,11 @@ 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']) + && !self::allowUpdateRevenueRecognitionDate($contributionID) + ) { + unset($params['revenue_recognition_date']); + } if (!isset($params['tax_amount']) && $setPrevContribution && (isset($params['total_amount']) || isset ($params['financial_type_id']))) { -- 2.25.1