From 6af8e0aa34e2f7224bb97a30707e5e4ed5daf5f7 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 15 Nov 2018 11:02:08 -0500 Subject: [PATCH] cierre bug suma en campo formula --- funciones/funciones.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 8734fa6..b2dc67c 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -16586,19 +16586,20 @@ elseif($campo_tipo_accion == 'email'){$render = " } elseif($campo_tipo_accion == 'calc'){ $regex = '(\[([^]]+)\])i'; - $sustitucion = "(document.getElementById('$1[0]').value)"; + $sustitucion = "parseFloat(document.getElementById('$1[0]').value)"; $campos_valores = remplacetas('form_campos_valores','id_form_campo',$id_campo,'campo_valor',"") ; preg_match("$regex", $campos_valores[0], $matches); $remplace = preg_replace($regex,$sustitucion,$campos_valores[0]); + $remplace= "( $remplace )"; //$campos = print_r($matches,true); $render = "
-
Calcular
+
Calcular
-
+ eval($remplace) "; $cols='12'; }