projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #10988 from jmcclelland/CRM-21194
[civicrm-core.git]
/
api
/
v3
/
Contribution.php
diff --git
a/api/v3/Contribution.php
b/api/v3/Contribution.php
index 027725ff587456987b7c0abce8bd7be7af5df041..451e302d5832f505fc2b8a8cd6478fa19e8dc612 100644
(file)
--- a/
api/v3/Contribution.php
+++ b/
api/v3/Contribution.php
@@
-47,6
+47,13
@@
function civicrm_api3_contribution_create(&$params) {
$params = array_merge($params, $values);
// The BAO should not clean money - it should be done in the form layer & api wrapper
// (although arguably the api should expect pre-cleaned it seems to do some cleaning.)
$params = array_merge($params, $values);
// The BAO should not clean money - it should be done in the form layer & api wrapper
// (although arguably the api should expect pre-cleaned it seems to do some cleaning.)
+ if (empty($params['skipCleanMoney'])) {
+ foreach (['total_amount', 'net_amount', 'fee_amount'] as $field) {
+ if (isset($params[$field])) {
+ $params[$field] = CRM_Utils_Rule::cleanMoney($params[$field]);
+ }
+ }
+ }
$params['skipCleanMoney'] = TRUE;
if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) {
$params['skipCleanMoney'] = TRUE;
if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) {