CRM-16189 unset revenue recognition date when status <> pending
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 24 Aug 2016 03:16:21 +0000 (08:46 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 29 Aug 2016 13:20:32 +0000 (18:50 +0530)
----------------------------------------
* CRM-16189: Improve support for Accrual Method bookkeeping
  https://issues.civicrm.org/jira/browse/CRM-16189

CRM/Contribute/BAO/Contribution.php

index eff6ea3b0c6e13064b01212ff17b60c2154670e5..c4f44c0d1e8753b823ff8765f1835204e3945101 100644 (file)
@@ -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']);