[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 03/03: Task #1139 - Prix de vente/achat par
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 03/03: Task #1139 - Prix de vente/achat par pièce : passer de 2 digit à 4 digit après la virgule #1139 : rounded value for ANC (2 decimale) for key computing |
Date: |
Thu, 12 Nov 2015 17:49:06 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 176bcbb927964c9a21d76590cbbbd2103e279f62
Author: Dany De Bontridder <address@hidden>
Date: Thu Nov 12 18:41:46 2015 +0100
Task #1139 - Prix de vente/achat par pièce : passer de 2 digit à 4 digit
après la virgule
#1139 : rounded value for ANC (2 decimale) for key computing
---
html/js/anc_script.js | 1 +
include/ajax/ajax_anc_key_compute.php | 7 ++++++-
include/class/class_anc_key.php | 3 ++-
include/class/class_anc_operation.php | 1 +
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index 3e1351f..83ca95d 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 58c5e37..a5b46e2 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 <<<EOF
+<script>
+anc_refresh_remain('$target','$row');
+</script>
+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 c8af6ef..8467723 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 39b99c8..6465ab0 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.='<td>'.$value->input().'</td>';