From b895f8a78f4d03b5c6acbc0c785d79e260dc166b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 5 Oct 2019 21:19:55 +0200 Subject: [PATCH] api supplier get purchase prices --- htdocs/product/class/api_products.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index da7cd9fa780..346aef06a91 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -642,13 +642,12 @@ class Products extends DolibarrApi $this->product->load_stock(); } - if($result) { - $this->product = new ProductFournisseur($this->db); - $this->product->fetch($id, $ref); - $this->product->list_product_fournisseur_price($id, '', '', 0, 0); + if ($result) { + $this->productsupplier->fetch($id, $ref); + $this->productsupplier->list_product_fournisseur_price($id, '', '', 0, 0); } - return $this->_cleanObjectDatas($this->product); + return $this->_cleanObjectDatas($this->productsupplier); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore