diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index e1a485d1027..00fd71ea9db 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -687,7 +687,7 @@ class Commande $this->brouillon = 1; // exp pdf ----------- $this->lignes = array(); - $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,'; + $sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, l.coef,'; $sql.= ' p.label, p.description as product_desc, p.ref, p.fk_product_type, p.rowid as prodid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; @@ -712,6 +712,7 @@ class Commande $ligne->remise_percent = $objp->remise_percent; $ligne->price = $objp->price; $ligne->product_id = $objp->fk_product; + $ligne->coef = $objp->coef; $ligne->libelle = $objp->label; // Label produit $ligne->product_desc = $objp->product_desc; // Description produit diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 3c749268b0e..f607b3f87d8 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -183,3 +183,5 @@ ALTER TABLE llx_facture_rec ADD CONSTRAINT fk_facture_rec_fk_user_author FORE ALTER TABLE llx_facture_rec ADD CONSTRAINT fk_facture_rec_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); ALTER TABLE llx_facture_rec ADD UNIQUE INDEX idx_facture_rec_uk_titre (titre); + +alter table llx_commandedet add column coef real; diff --git a/mysql/tables/llx_commandedet.sql b/mysql/tables/llx_commandedet.sql index 4c313194423..e4c9aa77d2d 100644 --- a/mysql/tables/llx_commandedet.sql +++ b/mysql/tables/llx_commandedet.sql @@ -31,5 +31,6 @@ create table llx_commandedet remise_percent real DEFAULT 0, -- pourcentage de remise remise real DEFAULT 0, -- montant de la remise subprice real, -- prix avant remise - price real -- prix final + price real, -- prix final + coef real -- coefficient de marge )type=innodb;