cierre bug suma en campo formula

This commit is contained in:
humano 2018-11-15 11:02:08 -05:00
parent 6b690a4562
commit 6af8e0aa34

View File

@ -16586,19 +16586,20 @@ elseif($campo_tipo_accion == 'email'){$render = "
} }
elseif($campo_tipo_accion == 'calc'){ elseif($campo_tipo_accion == 'calc'){
$regex = '(\[([^]]+)\])i'; $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',"") ; $campos_valores = remplacetas('form_campos_valores','id_form_campo',$id_campo,'campo_valor',"") ;
preg_match("$regex", $campos_valores[0], $matches); preg_match("$regex", $campos_valores[0], $matches);
$remplace = preg_replace($regex,$sustitucion,$campos_valores[0]); $remplace = preg_replace($regex,$sustitucion,$campos_valores[0]);
$remplace= "( $remplace )";
//$campos = print_r($matches,true); //$campos = print_r($matches,true);
$render = " $render = "
<div class='input-group' > <div class='input-group' >
<input title = '$campo_descripcion' type='text' value='$value' id='".$id_campo."[".$item."]' name='".$id_campo."[".$item."]' class='form-control' placeholder='$campos_valores[0]' readonly> <input title = '$campo_descripcion' type='text' value='$value' id='".$id_campo."[".$item."]' name='".$id_campo."[".$item."]' class='form-control' placeholder='$campos_valores[0]' readonly>
<span class='input-group-btn'> <span class='input-group-btn'>
<div class='btn btn-warning' onclick=\"javascript: document.getElementById('".$id_campo."[".$item."]').value= eval($remplace); \">Calcular</div> <div class='btn btn-warning' onclick=\"javascript: document.getElementById('".$id_campo."[".$item."]').value= eval($remplace); \">Calcular </div>
</span> </span>
</div> </div>eval($remplace)
"; ";
$cols='12'; $cols='12';
} }