NEW inventory without virtual products (kits)

This commit is contained in:
VESSILLER 2022-12-09 15:44:36 +01:00
parent 7e80c626df
commit 1eb3c69acd

View file

@ -302,6 +302,13 @@ class Inventory extends CommonObject
$sql .= " AND cp.fk_categorie IN (".$this->db->sanitize($this->categories_product).")";
$sql .= ")";
}
if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) {
$sql .= " AND NOT EXISTS (";
$sql .= " SELECT pa.rowid";
$sql .= " FROM ".$this->db->prefix()."product_association as pa";
$sql .= " WHERE pa.fk_product_pere = ps.fk_product";
$sql .= ")";
}
$inventoryline = new InventoryLine($this->db);