CRM-16189, updated the docblock and checked isnull for previous recognition date
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jul 2016 15:29:01 +0000 (20:59 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jul 2016 15:29:01 +0000 (20:59 +0530)
----------------------------------------
* CRM-16189: Improve support for Accrual Method bookkeeping
  https://issues.civicrm.org/jira/browse/CRM-16189

CRM/Financial/BAO/FinancialAccount.php

index 3a69abde0e064a72b6fb007074ab78a467748a2a..a71a99eec4762a866541a088840cc7a621d86052 100644 (file)
@@ -361,10 +361,13 @@ LIMIT 1";
    * with Financial Account
    *
    * @param array $params
+   *   Holds submitted formvalues and params from api for updating/adding contribution
    *
    * @param int $contributionID
+   *   Contribution ID
    *
    * @param obj $form
+   *   Holds form object of CRM_Contribute_Form_Contribution
    *
    * @return bool
    *
@@ -375,7 +378,7 @@ LIMIT 1";
     }
     $recognitionDate = CRM_Utils_Array::value('revenue_recognition_date', $params);
     if (!(!CRM_Utils_System::isNull($recognitionDate)
-      || ($contributionID && $params['prevContribution']->revenue_recognition_date))
+      || ($contributionID && !CRM_Utils_System::isNull($params['prevContribution']->revenue_recognition_date)))
     ) {
       return FALSE;
     }