From 31ca17c619964ddc3b1172f661f6382273002054 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:06:21 +0100 Subject: [PATCH 1/3] fix require once --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23838ea1e62..7fbff101859 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2229,6 +2229,7 @@ class Form { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid "; if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) { + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $soc = new Societe($db); $result = $soc->fetch($socid); if ($result > 0 && !empty($soc->default_lang)) { From 1e8117dc8a446ffd68ff600072eebfde285d0b55 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:49:30 +0100 Subject: [PATCH 2/3] fix js --- htdocs/core/class/commonobject.class.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b9f98adfe04..6472ea8673e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7169,9 +7169,6 @@ abstract class CommonObject if ($(this).val() == 0){ $("#"+child_list).hide(); } - - $("select[name=\""+parent_list+"\"]").change(function() { - showOptions(child_list, parent_list, orig_select[child_list]); }); }); } From c0c60475388dbabe272fae177ce6532e3304723d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 8 Feb 2021 11:54:29 +0100 Subject: [PATCH 3/3] fix ajax product missing condigtion --- htdocs/product/ajax/products.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 5b297cb33a5..89e9419fec0 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -82,14 +82,10 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) $found = false; $price_level = 1; - if ($socid > 0 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { + if ($socid > 0 ) { $thirdpartytemp = new Societe($db); $thirdpartytemp->fetch($socid); - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - $price_level = $thirdpartytemp->price_level; - } - //Load translation description and label if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $newlang = $thirdpartytemp->default_lang; @@ -104,6 +100,10 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) $outlabel_trans = $object->label; } } + + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + $price_level = $thirdpartytemp->price_level; + } } // Price by qty