From a493ffb6aef513c60b4f08d750e1fd83862e972a Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 12 May 2017 01:37:22 +0530 Subject: [PATCH] CRM-20559, revenue recognition date should be set for event greater than current month ---------------------------------------- * CRM-20559: Revenue account is Deferred revenue rather than Revenue. https://issues.civicrm.org/jira/browse/CRM-20559 --- CRM/Event/Form/Participant.php | 2 +- CRM/Event/Form/Registration/Confirm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 144122ab17..ad4c2e7dbf 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -958,7 +958,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $additionalParticipantDetails = array(); if (CRM_Contribute_BAO_Contribution::checkContributeSettings('deferred_revenue_enabled')) { $eventStartDate = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_eventId, 'start_date'); - if ($eventStartDate) { + if (strtotime($eventStartDate) > strtotime(date('Ymt'))) { $contributionParams['revenue_recognition_date'] = date('Ymd', strtotime($eventStartDate)); } } diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index ff9f4258fd..7b8c7d1ffb 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -1027,7 +1027,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $form->_values ) ); - if ($eventStartDate) { + if (strtotime($eventStartDate) > strtotime(date('Ymt'))) { $contribParams['revenue_recognition_date'] = date('Ymd', strtotime($eventStartDate)); } } -- 2.25.1