BUG-14288 Evaluation not working properly with currency field SOLVED

- the field no float format.
- add function PMRemoveMask in file class.pmFunctions.php that erase the mask.
This commit is contained in:
Marco Antonio Nina
2014-05-19 12:07:59 -04:00
parent 35c96169f3
commit a97c3fbe34

View File

@@ -2837,3 +2837,29 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i
return $arrayData;
}
/**
*@method
*
* It delete the mask a field.
*
* @name PMFAddAttachmentToArray
*
* @param string | $field | Value the field
* @param string | $separator | Separator of thousands (, or .)
* @param string | $currency | symbol of currency
* @return $field | value without mask
*
*/
function PMRemoveMask ($field, $separator = '.', $currency = '')
{
$sep = array();
if ( trim($currency) != '') {
$sep[] = $currency;
}
$sep[] = ($separator == ',') ? '.' : ',';
$field = str_replace($sep, '', $field);
$field = trim(str_replace($separator, '.', $field));
return $field;
}