From: Pradeep Nayak Date: Thu, 21 Jul 2016 10:29:19 +0000 (+0530) Subject: CRM-16189, updated docblock X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ab6c306d4c45e7896d6805dad0562ca260fafb79;p=civicrm-core.git CRM-16189, updated docblock updated to code follow CiviCRM standard ---------------------------------------- * 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 2d833b7977..94f9bb5ae1 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1009,7 +1009,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $errors['revenue_recognition_date'] = ts('Month and Year are required field for Revenue Recognition.'); } // CRM-16189 - if (CRM_Financial_BAO_FinancialAccount::checkFinancialTypeHasDeferred($fields, $self->_id, $self)) { + if (CRM_Financial_BAO_FinancialAccount::checkFinancialTypeHasDeferred($fields, $self->_id, $self->_priceSet['fields'])) { $errors['financial_type_id'] = ' '; $errors['_qf_default'] = ts('Revenue recognition date can only be specified if the financial type selected has a deferred revenue account configured. Please have an administrator set up the deferred revenue account at Administer > CiviContribute > Financial Accounts, then configure it for financial types at Administer > CiviContribution > Financial Types, Accounts'); } diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index a71a99eec4..f02a4716ef 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -358,21 +358,21 @@ LIMIT 1"; /** * Validate Financial Type has Deferred Revenue account relationship - * with Financial Account + * with Financial Account. * * @param array $params - * Holds submitted formvalues and params from api for updating/adding contribution + * 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 + * @param array $priceSetFields + * Array of price fields of a price set. * * @return bool * */ - public static function checkFinancialTypeHasDeferred($params, $contributionID = NULL, $form = NULL) { + public static function checkFinancialTypeHasDeferred($params, $contributionID = NULL, $priceSetFields = NULL) { if (!CRM_Contribute_BAO_Contribution::checkContributeSettings('deferred_revenue_enabled')) { return FALSE; } @@ -390,7 +390,7 @@ LIMIT 1"; } if (($contributionID || !empty($params['price_set_id'])) && empty($lineItems)) { if (!$contributionID) { - CRM_Price_BAO_PriceSet::processAmount($form->_priceSet['fields'], + CRM_Price_BAO_PriceSet::processAmount($priceSetFields, $params, $items); } else { @@ -421,6 +421,13 @@ LIMIT 1"; * with Financial Account. * * @param int $financialTypeId + * Financial Type Id. + * + * @param int $entityID + * Holds id for PriceSet/PriceField/PriceFieldValue. + * + * @param string $entity + * Entity like PriceSet/PriceField/PriceFieldValue. * * @return bool *