Salut,
Debutant je developpe une page web de calcul automatique de la TVA et TTC, mon probleme est que le calcul s'effectuera suivant des options du menu deroulant (je suis novice en JS ). je vous donne les formules:
cette est page conçue pour une association de bienfaisance, votre contribution sera donc un don.
Si nature de la vente= option 2,3 et 5 alors la tva=0
Si nature de la vente= option 1,4,6 et 7 alors tva= Montant HT*0,18
Et TTC=Montant HT+TVA
j'y joins le code html pour vous permettre de tester.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"> <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Document sans nom</title> <style type="text/css"> <!-- .Style1 { font-size: xx-large; font-weight: bold; } body { background-color: #CCCCCC; } .Style2 {font-size: medium; font-weight: bold; } --> </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <p align="center" class="Style1">Saisie Vente </p> <p align="left"> <label></label> </p> <p align="left" class="Style2"> <label>Nature chiffre d'affaire <select name="select"> <option>Montant des affaires à l'exportation taxable à l'interieur</option> <option>Montant des affaires à l'exportation non-taxable à l'interieur</option> <option>Montant des affaires éxénorées autres que les exportations </option> <option>Livraison à soi-même</option> <option>Montant des affaires réalisées en suspension</option> <option>Montant des affaires soumises au précompte de T.V.A</option> <option>Montant des autres affaires taxable à l'interieur</option> </select> </label> </p> <p> <label></label> </p> <p> <label><strong>Client</strong> <input name="textfield2" type="text" maxlength="40" /> </label> </p> <p> <label><strong>N°Facture</strong> <input name="textfield3" type="text" maxlength="15" /> </label> </p> <p> <label><strong>Montant H.T</strong> <input name="textfield4" type="text" value="0" maxlength="30" /> </label> </p> <p> <label><strong>TVA</strong> <input name="textfield5" type="text" value="0" maxlength="30" /> </label> </p> <p> <label><strong>Montant TTC</strong> <input type="text" name="textfield" /> </label> </p> </form> </body> </html>
Partager