From 2823b9d0d65a6babe0cdd4c943b87809a8eda85a Mon Sep 17 00:00:00 2001 From: Yamil Esteban Garcia <120027058+developmentOYR@users.noreply.github.com> Date: Sun, 10 Aug 2025 10:31:26 +0200 Subject: [PATCH] Modifications made to allow search by EAN even when selecting in the product variants module to hide product variants #34567 (#34612) * Error: When creating an invoice for a supplier order with a negative value #30516 Error: When creating an invoice for a supplier order with a negative value #30516 * Update html.form.class.php Modifications made related to the issue Search for variants by EAN #34567 * Update html.form.class.php I change : if(getDolGlobalString('SEARCH_VARIANTS_OF_EAN13')){ with if (getDolGlobalString('SEARCH_VARIANTS_OF_EAN13')) { and SEARCH_VARIANTS_OF_EAN13 into PRODUIT_ATTRIBUTES_HIDECHILD_BUT_ALLOW_SEARCH_IN_EAN13 * Update html.form.class.php * Update html.form.class.php * Update html.form.class.php * Update html.form.class.php * Update html.form.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/html.form.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 07b660002c7..d44ec0c9512 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3219,7 +3219,13 @@ class Form // Add WHERE conditions $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { - $sql .= " AND NOT EXISTS (SELECT pac.rowid FROM ".$this->db->prefix()."product_attribute_combination as pac WHERE pac.fk_product_child = p.rowid)"; + if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD_BUT_ALLOW_SEARCH_IN_EAN13')) { + if (strlen($filterkey) != 13) { + $sql .= " AND NOT EXISTS (SELECT pac.rowid FROM ".$this->db->prefix()."product_attribute_combination as pac WHERE pac.fk_product_child = p.rowid)"; + } + } else { + $sql .= " AND NOT EXISTS (SELECT pac.rowid FROM ".$this->db->prefix()."product_attribute_combination as pac WHERE pac.fk_product_child = p.rowid)"; + } } if ($finished == 0) { $sql .= " AND p.finished = " . ((int) $finished);