diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 7fd456c..cacf7be 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -1714,7 +1714,14 @@ class PageController extends Controller { ); $produits = json_decode($this->getProduitsById($facture->id_devis)); foreach ($produits as $key => $produit) { - $facture_temp['montant_htc'] += $produit->prix_unitaire * $produit->quantite; + $htPrice = $produit->prix_unitaire; + if($facture->fk_client_group_id != null || $facture->fk_client_group_id != 0){ + $price = $this->myDb->getProductPriceByClientGroupId($facture->fk_client_group_id,$produit->id); + if($price != null){ + $htPrice = $price; + } + } + $facture_temp['montant_htc'] += $htPrice * $produit->quantite; }; $facture_temp['montant_tva'] = ($facture_temp['montant_htc'] * $facture_temp['tva'])/100; $facture_temp['montant_ttc'] = $facture_temp['montant_tva'] + $facture_temp['montant_htc']; diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index ccfbe3a..8fe35f2 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -350,6 +350,7 @@ class Bdd { .$this->tableprefix."client.id as id_cli, ".$this->tableprefix."client.entreprise as client_entreprise, ".$this->tableprefix."client.fk_client_group_facturation_id as fk_client_group_facturation_id, " .$this->tableprefix."client.adresse as adresse_cli,".$this->tableprefix."client.mail as mail_cli, " .$this->tableprefix."client.telephone as telephone_cli,".$this->tableprefix."client.legal_one as legalone_cli, " + .$this->tableprefix."client.fk_client_group_id as fk_client_group_id, " .$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt, " .$this->tableprefix."lieu.id as lid, ".$this->tableprefix."lieu.nom as lieu,".$this->tableprefix."lieu.adresse as adresse_soin,".$this->tableprefix."devis.id_lieu FROM (".$this->tableprefix."facture