added validation for money

This commit is contained in:
CiviWare Solutions 2018-08-12 01:36:34 +05:30
parent cb23c5152b
commit aa4779024c

View File

@ -15,6 +15,9 @@
function civicrm_api3_grant_budget_create($params) {
if (!empty($params['budget'])) {
$params['budget'] = CRM_Utils_Rule::cleanMoney($params['budget']);
if (!is_numeric($params['budget'] )) {
throw new Exception(ts('Annual Budget is not in money format.'));
}
}
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'GrantBudget');
}