0byt3m1n1
Path:
/
home
/
k
/
a
/
s
/
kassiope
/
www
/
lib
/
class
/
[
Home
]
File: caddie.php
<? class Caddie { /* D�claration des tableaux */ var $articles; /* Tableau des articles */ var $reference; /* Tableau des articles */ var $quantite; /* Tableau des quantités */ var $poids; /* Tableau des poids */ var $liste_id; /* Tableau des poids */ var $pack; /* Tableau des packs */ var $is_offert; /* Tableau des packs */ var $couleur; /* Tableau des couleurs */ var $taille; /* Tableau des tailles */ var $systeme; /* Tableau des tailles */ var $profil; /* Tableau des tailles */ var $comment; /* Tableau des commentaires */ var $prix_cat; /* Tableau des prix catalogue TTC*/ var $prix_cat_ht; /* Tableau des prix catalogue HT*/ var $prix; /* Tableau des prix unitaire TTC*/ var $prix_ht; /* Tableau des prix unitaire HT*/ var $total_prix; /* Net produit vendu TTC prix x qte*/ var $total_prix_ht; /* Net produit vendu HT prix_ht x qte */ var $tva_percent; /* Tableau des taux de tva */ var $tva; /* Tableau des tva en valeur */ var $remise_produit_percent; /* Tableau des remises produits en % */ var $remise_produit; /* Tableau des remises produits en valeur */ var $points; /* Tableau des points clients */ var $etat_stock; /* Tableau stock produit g�r� ou non*/ var $delivery_stock; /* Tableau d�lai d'approvisionnement du stock */ var $option; /* Tableau du prix des options */ var $email_check; /* Tableau des emails amis */ /* D�claration des variables */ var $total; /* Montant total du caddie */ var $total_ht; /* Montant total du caddie HT */ var $total_tva; /* Montant total de la tva */ var $total_produit_avant_promo; var $total_produit_avant_promo_ht; var $total_produit; /* Montant total ttc la tva */ var $total_produit_ht; /* Montant total ttc la tva */ var $total_poids; /* Poids total du caddie */ var $total_points; /* Total des points cadeaux */ var $cout_transport; var $cout_transport_ht; var $tva_transport; var $total_remise_speciale; /* Total des remises speciale en valeur */ var $total_remise_speciale_ht; /* Total des remises speciale en valeur */ var $remise_speciale_percent; /* Remises spéciale en % */ var $total_remise_produit; /* Total des remises produits en valeur */ var $total_remise_produit_ht; /* Total des remises produits en valeur */ var $total_remise_client; /* Total des remises clients en valeur */ var $total_remise_client_ht; /* Total des remises clients en valeur */ var $remise_client_percent; /* Remises clients en % */ var $total_remise_code; /* Total des remises codes promo en valeur */ var $total_remise_code_ht; /* Total des remises codes promo en valeur */ var $remise_code_percent; /* Remises codes promo en % */ var $remise_code_port; /* Remises codes promo en % */ var $total_remise_cheque; /* Total des remises par ch�que cadeau en valeur */ var $total_remise_cheque_ht; /* Total des remises par ch�que cadeau en valeur */ var $code_cheque; /* Code cheque cadeau */ var $emballage; var $txt_emballage; var $total_remise_bon; /* Total des remises par bons de r�duction en valeur */ var $total_remise_bon_ht; /* Total des remises par bons de r�duction en valeur */ var $code_bon; /* Code bon de r�duction */ var $avoir; /* Avoir client en EURO */ var $type; var $zone; var $zoneTva; var $pays; var $paiement; var $tarif_paiement; /* suppl�ment pour le paiement */ var $code_promo; /* Nom du code promo */ var $ecotaxe_ttc; var $ecotaxe_ht; var $ecotaxe_tva; function Caddie() { /* constructeur d'object */ $this->init(); } function init() { /* Initialise le caddie */ $this->articles = array(); $this->reference = array(); $this->quantite = array(); $this->pack = array(); $this->is_offert = array(); $this->couleur = array(); $this->taille = array(); $this->systeme = array(); $this->profil = array(); $this->prix = array(); $this->prix_ht = array(); $this->total_prix = array(); $this->total_prix_ht = array(); $this->prix_cat = array(); $this->prix_cat_ht = array(); $this->tva_percent = array(); $this->tva = array(); $this->comment = array(); $this->poids = array(); $this->liste_id = array(); $this->points = array(); $this->remise_produit_percent = array(); $this->remise_produit = array(); $this->etat_stock = array(); $this->delivery_stock = array(); $this->option = array(); $this->email_check = array(); $this->total = 0; $this->avoir = 0; $this->total_ht = 0; $this->total_tva = 0; $this->total_produit_avant_promo = 0; $this->total_produit_avant_promo_ht = 0; $this->total_produit = 0; $this->total_produit_ht = 0; $this->total_poids = 0; $this->total_points = 0; $this->cout_transport = 0; $this->cout_transport_ht = 0; $this->tva_transport = 0; $this->total_remise_produit = 0; $this->total_remise_produit_ht = 0; $this->total_remise_client = 0; $this->total_remise_client_ht = 0; $this->remise_client_percent = 0; $this->total_remise_speciale = 0; $this->total_remise_speciale_ht = 0; $this->remise_speciale_percent = 0; $this->total_remise_code = 0; $this->total_remise_code_ht = 0; $this->remise_code_percent = 0; $this->remise_code_port = 0; $this->type = ""; $this->zone = ""; $this->zoneTva = 1; $this->pays = ""; $this->paiement = ""; $this->tarif_paiement = 0; $this->code_promo = ""; $this->emballage = 0; $this->txt_emballage = ""; $this->code_cheque = ""; $this->total_remise_cheque = 0; $this->total_remise_cheque_ht = 0; $this->code_bon = ""; $this->total_remise_bon = 0; $this->total_remise_bon_ht = 0; } function ajout( &$produitid, $reference, $qte, $pack, $is_offert, $couleur, $taille, $systeme, $profil, $prix_cat, $prix_cat_ht, $prix, $prix_ht, $total_prix, $total_prix_ht, $tva_percent, $tva, $poids, $liste_id, $points, $remise_produit_percent, $remise_produit, $comment, $etat_stock, $delivery_stock, $option, $email_check) { $this->articles[] = $produitid; $this->reference[] = $reference; $this->quantite[] = $qte; $this->pack[] = $pack; $this->is_offert[] = $is_offert; $this->couleur[] = $couleur; $this->taille[] = $taille; $this->systeme[] = $systeme; $this->profil[] = $profil; $this->prix_cat[] = $prix_cat; $this->prix_cat_ht[] = $prix_cat_ht; $this->prix[] = $prix; $this->prix_ht[] = $prix_ht; $this->total_prix[] = $total_prix; $this->total_prix_ht[] = $total_prix_ht; $this->tva_percent[] = $tva_percent; $this->tva[] = $tva; $this->poids[] = $poids; $this->liste_id[] = $liste_id; $this->points[] = $points; $this->remise_produit_percent[] = $remise_produit_percent; $this->remise_produit[] = $remise_produit; $this->comment[] = $comment; $this->etat_stock[] = $etat_stock; $this->delivery_stock[] = $delivery_stock; $this->option[] = $option; $this->email_check[] = $email_check; } function modif( $i, $produitid, $reference, $qte, $pack, $is_offert, $couleur, $taille, $systeme, $profil, $prix_cat, $prix_cat_ht, $prix, $prix_ht, $total_prix, $total_prix_ht, $tva_percent, $tva, $poids, $liste_id, $points, $remise_produit_percent, $remise_produit, $comment, $etat_stock, $delivery_stock, $option, $email_check) { /* Met la quantit� la couleur et la taille sp�cifi�es du produit sp�cifi� dans le caddie */ if (isset($i)) { $this->articles[$i] = (int) $produitid; $this->reference[$i] = $reference; $this->quantite[$i] = $qte; $this->pack[$i] = $pack; $this->is_offert[$i] = $is_offert; $this->couleur[$i] = $couleur; $this->taille[$i] = $taille; $this->systeme[$i] = $systeme; $this->profil[$i] = $profil; $this->prix_cat[$i] = $prix_cat; $this->prix_cat_ht[$i] = $prix_cat_ht; $this->prix[$i] = $prix; $this->prix_ht[$i] = $prix_ht; $this->total_prix[$i] = $total_prix; $this->total_prix_ht[$i] = $total_prix_ht; $this->tva_percent[$i] = $tva_percent; $this->tva[$i] = $tva; $this->poids[$i] = $poids; $this->liste_id[$i] = $liste_id; $this->points[$i] = $points; $this->remise_produit_percent[$i] = $remise_produit_percent; $this->remise_produit[$i] = $remise_produit; $this->comment[$i] = $comment; $this->etat_stock[$i] = $etat_stock; $this->delivery_stock[$i] = $delivery_stock; $this->option[$i] = $option; $this->email_check[$i] = $email_check; } ksort($this->articles); ksort($this->reference); ksort($this->quantite); ksort($this->pack); ksort($this->is_offert); ksort($this->couleur); ksort($this->taille); ksort($this->systeme); ksort($this->profil); ksort($this->prix); ksort($this->prix_ht); ksort($this->total_prix); ksort($this->total_prix_ht); ksort($this->prix_cat); ksort($this->prix_cat_ht); ksort($this->tva_percent); ksort($this->tva); ksort($this->poids); ksort($this->liste_id); ksort($this->points); ksort($this->remise_produit_percent); ksort($this->remise_produit); ksort($this->comment); ksort($this->etat_stock); ksort($this->delivery_stock); ksort($this->option); ksort($this->email_check); } function place( $i, $produitid, $reference, $qte, $pack, $is_offert, $couleur, $taille, $systeme, $profil, $prix_cat, $prix_cat_ht, $prix, $prix_ht, $total_prix, $total_prix_ht, $tva_percent, $tva, $poids, $liste_id, $points, $remise_produit_percent, $remise_produit, $comment, $etat_stock, $delivery_stock, $option, $email_check) { if (isset($i)) { $this->articles[$i] = (int) $produitid; $this->reference[$i] = $reference; $this->quantite[$i] = $qte; $this->pack[$i] = $pack; $this->is_offert[$i] = $is_offert; $this->couleur[$i] = $couleur; $this->taille[$i] = $taille; $this->systeme[$i] = $systeme; $this->profil[$i] = $profil; $this->prix_cat[$i] = $prix_cat; $this->prix_cat_ht[$i] = $prix_cat_ht; $this->prix[$i] = $prix; $this->prix_ht[$i] = $prix_ht; $this->total_prix[$i] = $total_prix; $this->total_prix_ht[$i] = $total_prix_ht; $this->tva_percent[$i] = $tva_percent; $this->tva[$i] = $tva; $this->poids[$i] = $poids; $this->liste_id[$i] = $liste_id; $this->points[$i] = $points; $this->remise_produit_percent[$i] = $remise_produit_percent; $this->remise_produit[$i] = $remise_produit; $this->comment[$i] = $comment; $this->etat_stock[$i] = $etat_stock; $this->delivery_stock[$i] = $delivery_stock; $this->option[$i] = $option; $this->email_check[$i] = $email_check; } ksort($this->articles); ksort($this->reference); ksort($this->quantite); ksort($this->pack); ksort($this->is_offert); ksort($this->couleur); ksort($this->taille); ksort($this->systeme); ksort($this->profil); ksort($this->prix); ksort($this->prix_ht); ksort($this->total_prix); ksort($this->total_prix_ht); ksort($this->prix_cat); ksort($this->prix_cat_ht); ksort($this->tva_percent); ksort($this->tva); ksort($this->poids); ksort($this->liste_id); ksort($this->points); ksort($this->remise_produit_percent); ksort($this->remise_produit); ksort($this->comment); ksort($this->etat_stock); ksort($this->delivery_stock); ksort($this->option); ksort($this->email_check); } function enleve_offert() { /* Cette fonction nettoie le caddie, en enlevant tous les produits non valides * c'est à dire ceux dont l'identifiant n'est pas numérique ou dont la quantité est < 1 */ foreach ($this->is_offert as $i => $kdo) { if ($kdo > 0) { /* Attention ici normalement on nettoie si la quantité commandée est < à 1 */ unset($this->articles[$i]); unset($this->reference[$i]); unset($this->quantite[$i]); unset($this->pack[$i]); unset($this->is_offert[$i]); unset($this->couleur[$i]); unset($this->taille[$i]); unset($this->systeme[$i]); unset($this->profil[$i]); unset($this->prix[$i]); unset($this->prix_ht[$i]); unset($this->total_prix[$i]); unset($this->total_prix_ht[$i]); unset($this->prix_cat[$i]); unset($this->prix_cat_ht[$i]); unset($this->tva_percent[$i]); unset($this->tva[$i]); unset($this->poids[$i]); unset($this->liste_id[$i]); unset($this->points[$i]); unset($this->remise_produit_percent[$i]); unset($this->remise_produit[$i]); unset($this->comment[$i]); unset($this->etat_stock[$i]); unset($this->delivery_stock[$i]); unset($this->option[$i]); unset($this->email_check[$i]); } } $this->articles = array_values ($this->articles); $this->reference = array_values ($this->reference); $this->quantite = array_values ($this->quantite); $this->pack = array_values ($this->pack); $this->is_offert = array_values ($this->is_offert); $this->couleur = array_values ($this->couleur); $this->taille = array_values ($this->taille); $this->systeme = array_values ($this->systeme); $this->profil = array_values ($this->profil); $this->prix = array_values ($this->prix); $this->prix_ht = array_values ($this->prix_ht); $this->total_prix = array_values ($this->total_prix); $this->total_prix_ht = array_values ($this->total_prix_ht); $this->prix_cat = array_values ($this->prix_cat); $this->prix_cat_ht = array_values ($this->prix_cat_ht); $this->tva = array_values ($this->tva); $this->tva_percent = array_values ($this->tva_percent); $this->poids = array_values ($this->poids); $this->liste_id = array_values ($this->liste_id); $this->points = array_values ($this->points); $this->remise_produit_percent = array_values ($this->remise_produit_percent); $this->remise_produit = array_values ($this->remise_produit); $this->comment = array_values ($this->comment); $this->etat_stock = array_values ($this->etat_stock); $this->delivery_stock = array_values ($this->delivery_stock); $this->option = array_values ($this->option); $this->email_check = array_values ($this->email_check); } function verif_offert() { $offert = 0; foreach ($this->is_offert as $i => $kdo) { if ($kdo > 0) $offert = $this->articles[$i]; } return $offert; } function paiement(&$paiement, &$tarif_paiement) { /* Traitement du moyen de paiement */ if (isset($paiement)) { $this->paiement = $paiement; $this->tarif_paiement = $tarif_paiement; } } function code_promo(&$code_promo, &$remise_code_percent, &$remise_code_port) { /* Ajoute dans le caddie le code promo et la remise du code promo */ if (isset($code_promo)) { $this->code_promo = $code_promo; $this->remise_code_percent = $remise_code_percent; $this->remise_code_port = $remise_code_port; } } function cheque_cadeau(&$code_cheque, &$total_remise_cheque) { if (isset($code_cheque)) { $this->code_cheque = $code_cheque; $this->total_remise_cheque = $total_remise_cheque; } } function amballage_cadeau(&$emballage, &$txt_emballage) { if (isset($emballage)) { $this->emballage = $emballage; $this->txt_emballage = $txt_emballage; } } function bon_reduction(&$code_bon, &$total_remise_bon) { /* Ajoute dans le caddie le bon de r�duction et la remise du code promo */ if (isset($code_bon)) { $this->code_bon = $code_bon; $this->total_remise_bon = $total_remise_bon; } } function pays(&$pays) { /* Ajoute dans le caddie le pays d'exp�dition */ if (isset($pays)) { $this->pays = $pays; } } function zone(&$zone, &$zoneTva) { /* Ajoute dans le caddie la zone d'exp�dition */ if (isset($zone)) { $this->zone = $zone; $this->zoneTva = $zoneTva; } } function type(&$type) { /* Ajoute dans le caddie la zone d'exp�dition */ if (isset($type)) { $this->type = $type; } } function remise_speciale(&$remise) { /* Ajoute dans le caddie la remise speciale */ if (isset($remise)) { $this->remise_speciale_percent = $remise; } } function expedition(&$expedition, &$expedition_ht) { /* Ajoute dans le caddie la zone d'exp�dition */ if (isset($expedition)) { $this->cout_transport = $expedition; $this->cout_transport_ht = $expedition_ht; $this->tva_transport = $this->cout_transport - $this->cout_transport_ht; } } function enleve(&$numero_ligne) { /* Enl�ve un produit du caddie */ if (isset($numero_ligne)) { unset( $this->articles[$numero_ligne], $this->reference[$numero_ligne], $this->quantite[$numero_ligne], $this->pack[$numero_ligne], $this->is_offert[$numero_ligne], $this->couleur[$numero_ligne], $this->taille[$numero_ligne], $this->systeme[$numero_ligne], $this->profil[$numero_ligne], $this->prix[$numero_ligne], $this->prix_ht[$numero_ligne], $this->total_prix[$numero_ligne], $this->total_prix_ht[$numero_ligne], $this->prix_cat[$numero_ligne], $this->prix_cat_ht[$numero_ligne], $this->tva[$numero_ligne], $this->tva_percent[$numero_ligne], $this->poids[$numero_ligne], $this->liste_id[$numero_ligne], $this->points[$numero_ligne], $this->remise_produit_percent[$numero_ligne], $this->remise_produit[$numero_ligne], $this->comment[$numero_ligne], $this->etat_stock[$numero_ligne], $this->delivery_stock[$numero_ligne], $this->option[$numero_ligne], $this->email_check[$numero_ligne]); } $this->articles = array_values ($this->articles); $this->reference = array_values ($this->reference); $this->quantite = array_values ($this->quantite); $this->pack = array_values ($this->pack); $this->is_offert = array_values ($this->is_offert); $this->couleur = array_values ($this->couleur); $this->taille = array_values ($this->taille); $this->systeme = array_values ($this->systeme); $this->profil = array_values ($this->profil); $this->prix = array_values ($this->prix); $this->prix_ht = array_values ($this->prix_ht); $this->total_prix = array_values ($this->total_prix); $this->total_prix_ht = array_values ($this->total_prix_ht); $this->prix_cat = array_values ($this->prix_cat); $this->prix_cat_ht = array_values ($this->prix_cat_ht); $this->tva = array_values ($this->tva); $this->tva_percent = array_values ($this->tva_percent); $this->poids = array_values ($this->poids); $this->liste_id = array_values ($this->liste_id); $this->points = array_values ($this->points); $this->remise_produit_percent = array_values ($this->remise_produit_percent); $this->remise_produit = array_values ($this->remise_produit); $this->comment = array_values ($this->comment); $this->etat_stock = array_values ($this->etat_stock); $this->delivery_stock = array_values ($this->delivery_stock); $this->option = array_values ($this->option); $this->email_check = array_values ($this->email_check); } function nettoie() { /* Cette fonction nettoie le caddie, en enlevant tous les produits non valides * c'est à dire ceux dont l'identifiant n'est pas numérique ou dont la quantité est < 1 */ foreach ($this->quantite as $i => $qte) { if ($qte < 0) { /* Attention ici normalement on nettoie si la quantité commandée est < à 1 */ unset($this->articles[$i]); unset($this->reference[$i]); unset($this->quantite[$i]); unset($this->pack[$i]); unset($this->is_offert[$i]); unset($this->couleur[$i]); unset($this->taille[$i]); unset($this->systeme[$i]); unset($this->profil[$i]); unset($this->prix[$i]); unset($this->prix_ht[$i]); unset($this->total_prix[$i]); unset($this->total_prix_ht[$i]); unset($this->prix_cat[$i]); unset($this->prix_cat_ht[$i]); unset($this->tva_percent[$i]); unset($this->tva[$i]); unset($this->poids[$i]); unset($this->liste_id[$i]); unset($this->points[$i]); unset($this->remise_produit_percent[$i]); unset($this->remise_produit[$i]); unset($this->comment[$i]); unset($this->etat_stock[$i]); unset($this->delivery_stock[$i]); unset($this->option[$i]); unset($this->email_check[$i]); } } } function compte_elements() { /* Renvoie le nombre d'articles dans le caddie */ $total = 0; if (!empty($this->quantite)) { foreach ($this->quantite as $qte) { $total += $qte; } } return $total; } function recupere_produitid_list() { /* Renvoie la liste des produits délimités par des virgules */ $produitid_list = ""; foreach ($this->articles as $produitid => $quantite) { $produitid_list .= ",'" . $produitid . "'"; } /* Enlève la virgule du début */ return substr($produitid_list, 1); } function recupere_liste_du_caddie() { /* Renvoie une variable tableau de la liste des produitid */ $liste_du_caddie = array(); foreach ($this->articles as $i =>/*$produitid =>*/ $produitid) { $liste_du_caddie[$i]=$produitid; } return $liste_du_caddie; } function recalc_total() { /* Recalcule le prix total des articles du caddie */ $this->total = 0; $this->total_ht = 0; $this->total_produit_avant_promo = 0; $this->total_produit_avant_promo_ht = 0; $this->total_produit = 0; $this->total_produit_ht = 0; $this->total_tva = 0; $this->total_remise_produit = 0; $this->total_remise_produit_ht = 0; $this->total_remise_client = 0; $this->total_remise_client_ht = 0; $this->total_remise_code = 0; $this->total_remise_code_ht = 0; $this->total_remise_cheque_ht = 0; $this->total_remise_bon_ht = 0; $this->total_poids = 0; $this->total_points = 0; if($_SESSION['utilisateur']['priv'] != 'reve') $this->remise_client_percent = vn($_SESSION['utilisateur']['remise_percent']); $this->avoir = vn($_SESSION['utilisateur']['avoir']); $this->ecotaxe_ttc = 0; $this->ecotaxe_ht = 0; $this->ecotaxe_tva = 0; foreach ($this->articles as $i => $produitid) { $qid = mysql_query_override("SELECT id, poids, points, promotion, id_ecotaxe FROM gaia_produits WHERE id= '$produitid'"); if ($qid) { if (mysql_num_rows_override($qid) > 0) { $produit=mysql_fetch_array_override($qid); $reseco = mysql_query_override("SELECT prix_ht, prix_ttc FROM gaia_ecotaxes WHERE id = '".intval($produit['id_ecotaxe'])."'"); if (mysql_num_rows_override($reseco) > 0) { $eco = mysql_fetch_object_override($reseco); $this->ecotaxe_ht += $eco->prix_ht * $this->quantite[$i]; $this->ecotaxe_ttc += $eco->prix_ttc * $this->quantite[$i]; } $this->total_produit += $this->total_prix[$i] ; #- Ce total inclut la remise produit, il s'agit du total ttc des produits avant promo et frais de port $this->total_produit_ht += $this->total_prix_ht[$i] ; $this->total_tva += $this->tva[$i] ; $this->total_remise_produit += $this->remise_produit[$i] ; #- A titre indicatif uniquement $this->total_remise_produit_ht += $this->remise_produit[$i] / (1 + $this->tva[$i]) ; #- A titre indicatif uniquement $this->total_poids += $this->quantite[$i] * $this->poids[$i] ; $this->total_points += $this->quantite[$i] * $this->points[$i] ; } } } $this->ecotaxe_tva = $this->ecotaxe_ttc - $this->ecotaxe_ht ; $this->total_tva = $this->ecotaxe_tva + $this->total_tva; $this->total_produit_avant_promo = $this->total_produit + $this->ecotaxe_ttc ; $this->total_produit_avant_promo_ht = $this->total_produit_ht + $this->ecotaxe_ht; $this->total_produit = $this->total_produit + $this->ecotaxe_ttc ; $this->total_produit_ht = $this->total_produit_ht + $this->ecotaxe_ht; /* On d�falque la remise client */ $this->total_remise_client = $this->total_produit * vn($this->remise_client_percent) / 100; $tva_remise_client = $this->total_remise_client * 0.2 / 1.2; $this->total_remise_client_ht = $this->total_remise_client - $tva_remise_client; $this->total_produit = $this->total_produit - $this->total_remise_client ; $this->total_tva = $this->total_tva - $tva_remise_client; /* On d�falque la remise spéciale */ $this->total_remise_speciale = $this->total_produit * vn($this->remise_speciale_percent) / 100; $tva_remise_speciale = $this->total_remise_speciale * 0.2 / 1.2; $this->total_remise_speciale_ht = $this->total_remise_speciale - $tva_remise_speciale; $this->total_produit = $this->total_produit - $this->total_remise_speciale ; $this->total_tva = $this->total_tva - $tva_remise_speciale; /* On d�falque la remise par code promotionnel */ if($this->remise_code_percent>0) { $this->total_remise_code = $this->total_produit * vn($this->remise_code_percent) /100; $tva_remise_code = 0; // $this->total_remise_code * 0.2 / 1.2; $this->total_remise_code_ht = $this->total_remise_code - $tva_remise_code; $this->total_produit = $this->total_produit - $this->total_remise_code; $this->total_tva = $this->total_tva - $tva_remise_code; } /* On d�falque la remise par ch�que cadeau */ $tva_remise_cheque = $this->total_remise_cheque * 0.2 / 1.2; $this->total_remise_cheque_ht = $this->total_remise_cheque - $tva_remise_cheque; $this->total_produit = $this->total_produit - $this->total_remise_cheque; $this->total_tva = $this->total_tva - $tva_remise_cheque; /* On d�falque la remise par bon de r�duction */ $tva_remise_bon = $this->total_remise_bon * 0.2 / 1.2; $this->total_remise_bon_ht = $this->total_remise_bon - $tva_remise_bon; $this->total_produit = $this->total_produit - $this->total_remise_bon; $this->total_tva = $this->total_tva - $tva_remise_bon; /* On d�falque l'avoir client */ $tva_avoir = $this->avoir * 0.2 / 1.2; $this->total_produit = $this->total_produit - $this->avoir; $this->total_tva = $this->total_tva - $tva_avoir; /* On ajoute l'emballage cadeau */ $tva_emballage = $this->emballage * 0.2 / 1.2; $this->total_produit = $this->total_produit + $this->emballage; $this->total_tva = $this->total_tva + $tva_emballage; $this->total_tva = $this->total_tva + $this->tva_transport; $this->total = $this->total_produit + $this->cout_transport + $this->tarif_paiement; $this->total_ht = $this->total - $this->total_tva; /* On calcul le cout global du caddie */ /* if($this->remise_code_port>0) { $this->total_remise_code = $this->cout_transport; $tva_remise_code = $this->tva_transport; $this->total_remise_code_ht = $this->total_remise_code - $tva_remise_code; $this->total_produit = $this->total_produit - $this->total_remise_code; $this->total_tva = $this->total_tva - $tva_remise_code; } */ /* On calcul le cout global du caddie */ if($this->remise_code_port>0) { $this->total_remise_code = $this->cout_transport; $tva_remise_code = $this->tva_transport; $this->total_remise_code_ht = $this->total_remise_code - $tva_remise_code; $this->total_produit = $this->total_produit - $this->total_remise_code; $this->total_tva = $this->total_tva - $tva_remise_code; } //$this->total_tva = $this->total_tva + $this->tva_transport; $this->total = $this->total_produit + $this->cout_transport + $this->tarif_paiement; $this->total_ht = $this->total - $this->total_tva; } } /* Variables pouvant �tre ajout� total_remise_client_ht : Total de la remise client HT tva_remise_client_ht : Total tva de la remise client total_remise_code_ht : Total de la remise code HT tva_remise_code_ht : Total tva de la remise code seuil revendeur seuil public */ ?>