This commit is contained in:
Laurent Destailleur 2020-04-27 14:38:45 +02:00
parent fe3359022a
commit 50d9f466d4
2 changed files with 20 additions and 7 deletions

View File

@ -137,6 +137,15 @@ class DolibarrApi
unset($object->labelStatus);
unset($object->labelStatusShort);
unset($object->stats_propale);
unset($object->stats_commande);
unset($object->stats_contrat);
unset($object->stats_facture);
unset($object->stats_commande_fournisseur);
unset($object->stats_reception);
unset($object->stats_mrptoconsume);
unset($object->stats_mrptoproduce);
unset($object->element);
unset($object->fk_element);
unset($object->table_element);

View File

@ -734,8 +734,6 @@ class Products extends DolibarrApi
}
/**
* List purchase prices
*
* Get a list of all purchase prices of products
*
* @param string $sortfield Sort field
@ -767,11 +765,11 @@ class Products extends DolibarrApi
if ($supplier > 0) {
$sql .= " AND s.fk_soc = ".$db->escape($supplier);
}
$sql .= " AND s.fk_product = t.rowid ";
$sql .= " AND s.fk_product = t.rowid";
// Select products of given category
if ($category > 0) {
$sql .= " AND c.fk_categorie = ".$db->escape($category);
$sql .= " AND c.fk_product = t.rowid ";
$sql .= " AND c.fk_product = t.rowid";
}
if ($mode == 1) {
// Show only products
@ -804,10 +802,15 @@ class Products extends DolibarrApi
while ($i < $min)
{
$obj = $db->fetch_object($result);
$product_static = new Product($db);
if ($product_static->fetch($obj->rowid)) {
$obj_ret[] = $this->_cleanObjectDatas($product_static);
$product_fourn = new ProductFournisseur($this->db);
$product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0);
foreach($product_fourn_list as $tmpobj) {
$this->_cleanObjectDatas($tmpobj);
}
//var_dump($product_fourn_list->db);exit;
$obj_ret[$obj->rowid] = $product_fourn_list;
$i++;
}
}
@ -1587,6 +1590,7 @@ class Products extends DolibarrApi
unset($object->prices_by_qty_id);
unset($object->libelle);
unset($object->product_id_already_linked);
unset($object->reputations);
unset($object->name);
unset($object->firstname);