+--------------------------------------------------------------------+
| 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
* $Id$
*
*/
$this->registerRule('amount', 'callback', 'money', 'CRM_Utils_Rule');
$this->addRule('amount', ts('Please enter a monetary value for this field.'), 'money');
+ $this->add('text', 'non_deductible_amount', ts('Non-deductible Amount'), NULL);
+ $this->registerRule('non_deductible_amount', 'callback', 'money', 'CRM_Utils_Rule');
+ $this->addRule('non_deductible_amount', ts('Please enter a monetary value for this field.'), 'money');
+
$this->add('textarea', 'description', ts('Description'));
$this->add('textarea', 'help_pre', ts('Pre Option Help'));
$this->add('textarea', 'help_post', ts('Post Option Help'));
$errors['count'] = ts('Participant count can not be greater than max participants.');
}
// CRM-16189
- $isError = CRM_Financial_BAO_FinancialAccount::validateFinancialType($fields['financial_type_id'], $form->_fid, 'PriceField');
- 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'], $form->_fid, 'PriceField');
+ }
+ catch (CRM_Core_Exception $e) {
+ $errors['financial_type_id'] = $e->getMessage();
}
return empty($errors) ? TRUE : $errors;
}