Calcul marche sur IE mais pas sur Firefox
Bonjour,
J'ai une formule de calcule qui marche sur internet explorer mais pas sur FireFox, Je parle du calcul TOTAL qui ne ce fait pas sur FireFox.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
function exporter<?=$i?>() {
var choix=document.getElementById("vc_ln");
document.forms["fmaddFacture"].elements["d<?=$i?>"].value=choix.value;
var choix=document.getElementById("vc_cpn");
document.forms["fmaddFacture"].elements["p<?=$i?>"].value=choix.value;
var choix=document.getElementById("vc_pn");
document.forms["fmaddFacture"].elements["n<?=$i?>"].value=choix.value;
var choix=document.getElementById("vc_em");
document.forms["fmaddFacture"].elements["ta<?=$i?>"].value=choix.value;
var total;
$TotalavantTVA = $('n<?=$i?>').value * $('p<?=$i?>').value;
$TotalTVA= $('n<?=$i?>').value*$('p0').value/100*$('ta<?=$i?>').value ;
$('to<?=$i?>').value = $TotalavantTVA + $TotalTVA;
$('to<?=$i?>').value = Math.round($('to<?=$i?>').value*100) / 100;
redoTotal();
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
function redoTotal(){
var rlt = 0;
var to = 0;
var n = 0;
var p = 0;
var ta = 0;
var tot_tax=0;
var tot_bt=0; //before tax.
for(var i=0; i< <?=$rowed2?>; i++){
to = 1*eval("document.fmaddFacture.to"+i+".value");
rlt = rlt + to;
//tax
n = 1*eval("document.fmaddFacture.n"+i+".value");
p = 1*eval("document.fmaddFacture.p"+i+".value");
tot_bt = tot_bt + 1*n*p;
ta = 1*eval("document.fmaddFacture.ta"+i+".value");
tot_tax = tot_tax+1*n*p*ta;
}
rlt = formatAsMoney(rlt);
tot_tax = formatAsMoney(tot_tax);
tot_bt = formatAsMoney(tot_bt);
document.fmaddFacture.totbt.value = tot_bt;
document.fmaddFacture.total.value = rlt;
//if exact tax based on grand total, not subtotal, uncomment the following line.
tot_tax = formatAsMoney(rlt - tot_bt);
document.fmaddFacture.tottax.value = tot_tax;
} |
Pouvez-vous m'aider SVP
Merci d'avance