Section courante

A propos

Section administrative du site

Le Canada est sans doute l'un des pays ou les taxes de vente sur les produits et services sont les plus compliqués à appliquer. Et pour cause : Elle varie d'une province ou territoire à l'autre, elle est parfois composé ou séparé. Voici leur représentation en date du mois septembre de l'année 2006 :

Province/Territoire Taxe 1 Taxe 2 Taux
Alberta TVH: 6% Aucune 6%
Colombie-Britanique TVH: 6% TVP: 7% 13%
Ile-du-Prince-Édouard TPS: 6% TVP: 10% 16.6%
Manitoba TPS: 6% TVP: 7% 13%
Nouveau-Brunswick TVH: 14% Aucune 14%
Nouvelle-Écosse TVH: 14% Aucune 14%
Nunavut TVH: 6% Aucune 6%
Ontario TPS: 6% TVP: 8% 14%
Québec TPS: 6% TVQ: 7.5% 13.95%
Saskatchewan TPS: 6% TVP: 7% 13%
Terre-Neuve/Labrador TVH: 14% Aucune 14%
Territoire du Nord Ouest TVH: 6% Aucune 6%
Territoire du Yukon TVH: 6% Aucune 6%

Tout d'abord, voici un premier exemple permet d'afficher des données complètes sur les taxes en JavaScript :

  1. <script type="text/javascript" language="javascript">
  2. var Compute=new Array("C","C","C","C","S","C","S","S","S","S","C","S","S");
  3. var TaxName1=new Array("TPS","TVH","TVH","TVH","TPS","TVH","TPS","TVH","TVH","TPS","TPS","TPS","TVH");
  4. var TaxRate1=new Array(6.0000,14.0000,14.0000,14.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000);
  5. var TaxName2=new Array("TVQ","","","","TVP","","TVP","","","TVP","TVP","TVP","");
  6. var TaxRate2=new Array(7.5000,0.0000,0.0000,0.0000,7.0000,0.0000,7.0000,0.0000,0.0000,8.0000,10.0000,7.0000,0.0000);
  7. var RegionMID=new Array("QC","NS","NB","NF","BC","AB","MB","NT","NU","ON","PE","SK","YT");
  8. var RegionName_EN=new Array("Quebec","Nova Scotia","New Brunswick","Newfoundland","British Columbia","Alberta","Manitoba","Northwest Territories","Nunavut","Ontario","Prince Edward Island","Saskatchewan","Yukon Territory");
  9. var RegionName_FR=new Array("Québec","Nouvelle-Écosse","Nouveau-Brunswick","Terre-Neuve/Labrador","Colombie-Britanique","Alberta","Manitoba","Territoire du Nord Ouest","Nunavut","Ontario","Ile-du-Prince-Édouard","Saskatchewan","Territoire du Yukon");
  10.      
  11. document.write("<TABLE>");
  12. document.write("<TR>");
  13. document.write("<TD><B>Nom de la province/territoire</B></TD>");
  14. document.write("<TD><B>MID</B></TD>");
  15. document.write("<TD><B>Taxe 1</B></TD>");
  16. document.write("<TD><B>Taxe 2</B></TD>");
  17. document.write("<TD><B>Taux</B></TD>");
  18. document.write("</TR>");
  19. for(var I=0;I<Compute.length;I++) {
  20.       document.write("<TR>");
  21.      document.write("<TD>"+RegionName_FR[I]+"</TD>");
  22.      document.write("<TD>"+RegionMID[I]+"</TD>");
  23.      document.write("<TD>"+TaxName1[I] + ":" + TaxRate1[I] + "%" + "</TD>");
  24.      if(TaxName2[I]=="") {
  25.         document.write("<TD> </TD>");
  26.      } else {
  27.         document.write("<TD>"+TaxName2[I] + ":" + TaxRate2[I] + "</TD>");
  28.      }
  29.       document.write("<TD>");
  30.      switch(Compute[I]) {
  31.           case 'S': //Séparé
  32.                document.write((TaxRate1[I]+TaxRate2[I]) + "%");
  33.                break;
  34.           case 'C': //Composé
  35.                document.write((TaxRate1[I]+((TaxRate2[I]*(100+TaxRate1[I]))/100)) + "%");
  36.                break;
  37.      }
  38.       document.write("</TD></TR>");
  39. }
  40.  
  41. </script>

on obtiendra le résultat suivant :

Nom de la province/territoireMIDTaxe 1Taxe 2Taux
QuébecQCTPS:6%TVQ:7.5%13.95%
Nouvelle-ÉcosseNSTVH:14% 14%
Nouveau-BrunswickNBTVH:14% 14%
Terre-Neuve/LabradorNFTVH:14% 14%
Colombie-BritaniqueBCTPS:6%TVP:7%13%
AlbertaABTVH:6% 6%
ManitobaMBTPS:6%TVP:7%13%
Territoire du Nord OuestNTTVH:6% 6%
NunavutNUTVH:6% 6%
OntarioONTPS:6%TVP:8%14%
Ile-du-Prince-ÉdouardPETPS:6%TVP:10%16.6%
SaskatchewanSKTPS:6%TVP:7%13%
Territoire du YukonYTTVH:6% 6%

Ensuite, voici un deuxième exemple permet de calculer la taxe de vente d'un produit ou service en fonction des provinces ou territoires en JavaScript :

  1. <script type="text/javascript" language="javascript">
  2. var Compute=new Array("C","C","C","C","S","C","S","S","S","S","C","S","S");
  3. var TaxName1=new Array("TPS","TVH","TVH","TVH","TPS","TVH","TPS","TVH","TVH","TPS","TPS","TPS","TVH");
  4. var TaxRate1=new Array(6.0000,14.0000,14.0000,14.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000,6.0000);
  5. var TaxName2=new Array("TVQ","","","","TVP","","TVP","","","TVP","TVP","TVP","");
  6. var TaxRate2=new Array(7.5000,0.0000,0.0000,0.0000,7.0000,0.0000,7.0000,0.0000,0.0000,8.0000,10.0000,7.0000,0.0000);
  7. var RegionMID=new Array("QC","NS","NB","NF","BC","AB","MB","NT","NU","ON","PE","SK","YT");
  8. var RegionName_EN=new Array("Quebec","Nova Scotia","New Brunswick","Newfoundland","British Columbia","Alberta","Manitoba","Northwest Territories","Nunavut","Ontario","Prince Edward Island","Saskatchewan","Yukon Territory");
  9. var RegionName_FR=new Array("Québec","Nouvelle-Écosse","Nouveau-Brunswick","Terre-Neuve/Labrador","Colombie-Britanique","Alberta","Manitoba","Territoire du Nord Ouest","Nunavut","Ontario","Ile-du-Prince-Édouard","Saskatchewan","Territoire du Yukon");
  10.      
  11. document.write("<TABLE>");
  12. document.write("<TR>");
  13. document.write("<TD><B>Nom de la province/territoire</B></TD>");
  14. document.write("<TD><B>Taxe 1</B></TD>");
  15. document.write("<TD><B>Taxe 2</B></TD>");
  16. document.write("<TD><B>Taux</B></TD>");
  17. document.write("<TD><B>1$</B></TD>");
  18. document.write("<TD><B>15$</B></TD>");
  19. document.write("<TD><B>44,95$</B></TD>");
  20. document.write("<TD><B>100$</B></TD>");
  21. document.write("</TR>" );
  22. for(var I=0;I<Compute.length;I++) {
  23.      var Tax = 0;
  24.       document.write("<TR>");
  25.      document.write("<TD>"+RegionName_FR[I]+"</TD>");
  26.      document.write("<TD>"+TaxName1[I] + ":" + TaxRate1[I] + "%" +"</TD>");
  27.      if(TaxName2[I]=="") {
  28.         document.write("<TD> </TD>");
  29.      } else {
  30.        document.write("<TD>"+TaxName2[I] + ":" + TaxRate2[I]+"</TD>");
  31.      }
  32.      switch(Compute[I]) {
  33.           case 'S': //Séparé
  34.                     Tax = TaxRate1[I]+TaxRate2[I];
  35.                break;
  36.           case 'C': //Composé
  37.                     Tax = TaxRate1[I]+((TaxRate2[I]*(100+TaxRate1[I]))/100);
  38.                break;
  39.      }
  40.        document.write("</TD>");
  41.       document.write("<TD>"+(Tax) + "%" + "</TD>");
  42.       document.write("<TD>"+(1*(1+(Tax/100))) + "$</TD>");
  43.       document.write("<TD>"+(15*(1+(Tax/100))) + "$</TD>");
  44.       document.write("<TD>"+(44.95*(1+(Tax/100))) + "$</TD>");
  45.       document.write("<TD>"+(100*(1+(Tax/100))) + "$</TD>");
  46.       document.write("</TR>");
  47. } 
  48. </script>

on obtiendra le résultat suivant :

Nom de la province/territoireTaxe 1Taxe 2Taux1$15$44,95$100$
QuébecTPS:6%TVQ:7.5%13.95%1.1395$17.0925$51.220525$113.95$
Nouvelle-ÉcosseTVH:14% 14%1.14$17.1$51.243$114$
Nouveau-BrunswickTVH:14% 14%1.14$17.1$51.243$114$
Terre-Neuve/LabradorTVH:14% 14%1.14$17.1$51.243$114$
Colombie-BritaniqueTPS:6%TVP:7%13%1.13$16.95$50.7935$113$
AlbertaTVH:6% 6%1.06$15.9$47.647$106$
ManitobaTPS:6%TVP:7%13%1.13$16.95$50.7935$113$
Territoire du Nord OuestTVH:6% 6%1.06$15.9$47.647$106$
NunavutTVH:6% 6%1.06$15.9$47.647$106$
OntarioTPS:6%TVP:8%14%1.14$17.1$51.243$114$
Ile-du-Prince-ÉdouardTPS:6%TVP:10%16.6%1.166$17.49$52.4117$116.6$
SaskatchewanTPS:6%TVP:7%13%1.13$16.95$50.7935$113$
Territoire du YukonTVH:6% 6%1.06$15.9$47.647$106$


Dernière mise à jour : Mercredi, le 5 octobre 2011