Merge pull request #12062 from frederic34/patch-13

remove stock data from getsupplierprice
This commit is contained in:
Laurent Destailleur 2019-10-08 14:50:41 +02:00 committed by GitHub
commit 71c18b7d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -607,7 +607,6 @@ class Products extends DolibarrApi
* @param string $ref Ref of element
* @param string $ref_ext Ref ext of element
* @param string $barcode Barcode of element
* @param int $includestockdata Load also information about stock (slower)
* @return array|mixed Data without useless information
*
* @url GET {id}/purchase_prices
@ -617,7 +616,7 @@ class Products extends DolibarrApi
* @throws 404
*
*/
public function getPurchasePrices($id, $ref = '', $ref_ext = '', $barcode = '', $includestockdata = 0)
public function getPurchasePrices($id, $ref = '', $ref_ext = '', $barcode = '')
{
if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) {
throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode');
@ -638,10 +637,6 @@ class Products extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if ($includestockdata) {
$this->product->load_stock();
}
if ($result) {
$this->productsupplier->fetch($id, $ref);
$this->productsupplier->list_product_fournisseur_price($id, '', '', 0, 0);