abracadabraPDF › Forums › PDF – Général › Formule de calcul non prise en compte dans l’onglet Calcul › Répondre à : Formule de calcul non prise en compte dans l’onglet Calcul
Pour ceux qui aiment le JavaScript, il en suffit d’un !
Placer ce script dans le champ de total (onglet calcul). Pour tester, rendre les champs taux.x et page2.dep.x saisissables et de format numérique.
//calcul des montants
console.clear();
console.println(« Calcul sur champ « +this.event.target.name+ » sur evenement « +this.event.name)
x=0;
total=0;
while(x
{
//test d’existance du champ « montant.x »
if(this.getField(« montant. »+x))
{
//calcul montant ligne
this.getField(« montant. »+x).value=this.getField(« page2.dep. »+x).value*this.getField(« taux. »+x+ ».1″).value;
console.println(« Calcul ligne « +x+ »= »+this.getField(« montant. »+x).value);
total=total+this.getField(« montant. »+x).value;
}
x=x+1;
}
//calcul du total en ajoutant le forfait fixe.
this.event.value=total+this.getField(« forfaitfixe »).value;