diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 3e1351f85..83ca95dea 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -419,6 +419,7 @@ function anc_key_compute(p_dossier, p_table, p_amount, p_key_id) var code_html = getNodeText(html[0]); // Firefox ne prend que les 4096 car. code_html = unescape_xml(code_html); $(name_ctl).innerHTML = code_html; + code_html.evalScripts(); removeDiv('div_anc_key_choice'); } catch (e) { diff --git a/include/ajax/ajax_anc_key_compute.php b/include/ajax/ajax_anc_key_compute.php index 58c5e3701..a5b46e23d 100644 --- a/include/ajax/ajax_anc_key_compute.php +++ b/include/ajax/ajax_anc_key_compute.php @@ -44,9 +44,14 @@ if ( isNumber($key)== 0 } $compute_key=new Anc_Key($key); +$row=str_replace('t', "", $target); $compute_key->fill_table($target,$amount); - +echo << +anc_refresh_remain('$target','$row'); + +EOF; //// $response = ob_get_clean(); $html = escape_xml($response); diff --git a/include/class/class_anc_key.php b/include/class/class_anc_key.php index c8af6efc1..8467723d5 100644 --- a/include/class/class_anc_key.php +++ b/include/class/class_anc_key.php @@ -320,7 +320,8 @@ class Anc_Key bcscale(2); for ($i=0;$i< count($a_amount);$i++) { - $val[$number][$i]=bcmul($p_amount,$a_amount[$i]['ke_percent'])/100; + $val[$number][$i]=bcmul($p_amount,$a_amount[$i]['ke_percent']); + $val[$number][$i]=bcdiv($val[$number][$i],100); } $array['val']=$val; diff --git a/include/class/class_anc_operation.php b/include/class/class_anc_operation.php index 39b99c894..6465ab03b 100644 --- a/include/class/class_anc_operation.php +++ b/include/class/class_anc_operation.php @@ -605,6 +605,7 @@ class Anc_Operation $value->name="val[".$p_seq."][]"; $value->size=6; $value->value=(isset($val[$p_seq][$i]))?$val[$p_seq][$i]:abs($p_amount); + $value->value=round($value->value,2); $value->readOnly=($p_mode==1)?false:true; $remain=bcsub($remain,$value->value); $result.=''.$value->input().'';