FIX prices by customer API
This commit is contained in:
parent
e3b5be7475
commit
0f80ba5353
@ -445,7 +445,6 @@ class Products extends DolibarrApi
|
|||||||
//'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code
|
//'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get prices per customer for a product
|
* Get prices per customer for a product
|
||||||
*
|
*
|
||||||
@ -471,13 +470,18 @@ class Products extends DolibarrApi
|
|||||||
if (! $result ) {
|
if (! $result ) {
|
||||||
throw new RestException(404, 'Product not found');
|
throw new RestException(404, 'Product not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result > 0) {
|
||||||
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
|
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
|
||||||
|
$prodcustprice = new Productcustomerprice($this->db);
|
||||||
|
$result = $prodcustprice->fetch_all('', '', 0, 0, array('t.fk_product' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RestException(501, 'Feature not yet available');
|
if ( empty($prodcustprice->lines)) {
|
||||||
//return $result;
|
throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($prodcustprice->error), $prodcustprice->errors));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prodcustprice->lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user