From d84e50d15c824ae19066f58ff665cedaeec89311 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 31 Jan 2017 23:11:16 +0100 Subject: [PATCH 1/2] get remisepercent of product if select list when we use the select list of product instead of free search we don't fill the remise --- htdocs/fourn/class/fournisseur.commande.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a4eda5ec81e..f656e7a41e7 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1408,6 +1408,11 @@ class CommandeFournisseur extends CommonOrder { $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice $ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice + // is remise percent not keyed but present for the product we add it + if ($remise_percent == 0 && $prod->remise_percent !=0) + $remise_percent =$prod->remise_percent; + + } if ($result == 0) // If result == 0, we failed to found the supplier reference price { From 772d862766a4832792c63a2e6a2b0a7caf0ea351 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 31 Jan 2017 23:13:58 +0100 Subject: [PATCH 2/2] Update product.class.php --- htdocs/product/class/product.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 34faaddfe4e..32ffbeead05 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1470,7 +1470,7 @@ class Product extends CommonObject $result = 0; // We do a first seach with a select by searching with couple prodfournprice and qty only (later we will search on triplet qty/product_id/fourn_ref) - $sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity,"; + $sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.remise_percent,"; $sql.= " pfp.fk_product, pfp.ref_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$prodfournprice; @@ -1504,6 +1504,7 @@ class Product extends CommonObject $this->fourn_price_base_type = 'HT'; // Price base type $this->ref_fourn = $obj->ref_fourn; // deprecated $this->ref_supplier = $obj->ref_fourn; // Ref supplier + $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $result=$obj->fk_product; return $result; @@ -1549,6 +1550,7 @@ class Product extends CommonObject $this->fourn_price_base_type = 'HT'; // Price base type for a virtual supplier $this->ref_fourn = $obj->ref_supplier; // deprecated $this->ref_supplier = $obj->ref_supplier; // Ref supplier + $this->remise_percent = $obj->remise_percent; // remise percent if present and not typed $this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier $result=$obj->fk_product; return $result;