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
|
SELECT Facture.MONTANT
FROM Facture
WHERE Facture.MONTANT =
(//Selection Prix Forfait de base
(SELECT Tarification.prix
FROM Tarification,Forfait,Contrat,Vehicule,Facture
WHERE Tarification.IDFORFAIT = Forfait.IDFORFAIT
AND Forfait.IDFORFAIT = Contrat.IDFORFAIT
AND Contrat.IDVEHICULE = Vehicule.IDVEHICULE
AND Facture.IDCONTRAT = Contrat.IDCONTRAT
AND Tarification.IDCATEGO = Vehicule.IDCATEGO
AND Facture.IDCONTRAT = "LPD20054328";)
+
//Selection Prix Kms Supplémentaires
(SELECT Distinct Categorie.PRIXKMSUP*Facture.KMSUP as KM
FROM Tarification,Forfait,Contrat,Categorie,Facture,Vehicule
WHERE Vehicule.IDCATEGO = Categorie.IDCATEGO
AND Contrat.IDCONTRAT = Facture.IDCONTRAT
AND Contrat.IDVEHICULE = Vehicule.IDVEHICULE
AND Facture.IDCONTRAT = "LPD20054328";)
+
//Selection Prix Jours Supplémentaires
(SELECT Distinct Categorie.PRIXKMSUP*Facture.KMSUP as KM
FROM Tarification,Forfait,Contrat,Categorie,Facture,Vehicule
WHERE Vehicule.IDCATEGO = Categorie.IDCATEGO
AND Contrat.IDCONTRAT = Facture.IDCONTRAT
AND Contrat.IDVEHICULE = Vehicule.IDVEHICULE
AND Facture.IDCONTRAT = "LPD20054328";)
+
//Selection Prix des Suppléments
(SELECT Sum(Supplement.PRIXSUPPL) as PrxSuppls
FROM Contrat,Ajoute,Supplement,Facture
WHERE Facture.IDCONTRAT = Contrat.IDCONTRAT
AND Contrat.IDCONTRAT = Ajoute.IDCONTRAT
AND Ajoute.IDSUPPL = Supplement.IDSUPPL
AND Facture.IDCONTRAT = "LPD20054328";)
); |
Partager