From a97c3fbe34eaf91033d1caee08055a93f6b6fbfd Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Mon, 19 May 2014 12:07:59 -0400 Subject: [PATCH] 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. --- workflow/engine/classes/class.pmFunctions.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index c9d22c336..1c769798a 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -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; +} \ No newline at end of file