Edit Modul-Data with missing currency value and decimal separator "," changes currency value
I am using comma as dezimal separator for currency fields. In edit mode of a Potential I deleted the "amount" field with javascript. In the return data of the potential the "amount" value is missing. After saving the data the value of the "amount" is changed. Most multiplicated by 1000. This is problem exists in all modules.
My solution in modules/Vtiger/actions/Save.php:
if($fieldValue !== null) { if(!is_array($fieldValue) && $fieldDataType != 'currency') { $fieldValue = trim($fieldValue); } $fieldValue = Vtiger_Util_Helper::validateFieldValue($fieldValue, $fieldModel); $recordModel->set($fieldName, $fieldValue); } elseif($fieldDataType == 'currency'){ $recordModel->set( $fieldName ,CurrencyField::convertToUserFormat($recordModel->get($fieldName,0))); }