fix price output in commoncard

This commit is contained in:
Florian HENRY 2021-03-16 09:59:45 +01:00
parent 177a6bfe4f
commit 9d8254eff4
2 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,8 @@ foreach ($object->fields as $key => $val) {
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
} elseif ($val['type'] == 'boolean') {
$value = (GETPOST($key) == 'on' ? 1 : 0);
} elseif ($val['type'] == 'price') {
$value = price2num(GETPOST($key));
} else {
$value = GETPOST($key, 'alphanohtml');
}

View File

@ -77,6 +77,8 @@ foreach ($object->fields as $key => $val) {
$check = 'restricthtml';
}
$value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
} elseif ($val['type'] == 'price') {
$value = price2num(GETPOST($key));
} else {
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
}