+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
&& (array_key_exists(CRM_Core_Component::getComponentID('CiviEvent'), $fields['extends'])
|| array_key_exists(CRM_Core_Component::getComponentID('CiviMember'), $fields['extends']))
) {
- $isError = CRM_Financial_BAO_FinancialAccount::validateFinancialType($fields['financial_type_id']);
- if ($isError) {
- $errors['financial_type_id'] = ts('Deferred revenue account is not configured for selected financial type. 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');
+ try {
+ CRM_Financial_BAO_FinancialAccount::validateFinancialType($fields['financial_type_id']);
+ }
+ catch (CRM_Core_Exception $e) {
+ $errors['financial_type_id'] = $e->getMessage();
}
}
return empty($errors) ? TRUE : $errors;
}
}
+ $this->addElement('text', 'min_amount', ts('Minimum Amount'));
+
if (CRM_Utils_System::isNull($extends)) {
$this->assign('extends', FALSE);
}