From 1eb3c69acd8befeb004ce35ec1f4796b5d0e7937 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 9 Dec 2022 15:44:36 +0100 Subject: [PATCH] NEW inventory without virtual products (kits) --- htdocs/product/inventory/class/inventory.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 9acc4232490..a45d82e12b0 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -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);