From d7bdb0941744ebce5763271c311014af8e685e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lina=20JOUM?= Date: Wed, 22 Jan 2025 11:28:44 +0100 Subject: [PATCH 1/2] FIX: If the constant PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES is active, allow you to choose the price level --- htdocs/product/admin/product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index d38409f9eaa..b31fae0df5f 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -608,7 +608,7 @@ print ''; // multiprix nombre de prix a proposer -if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { +if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { print ''; print ''.$langs->trans("MultiPricesNumPrices").''; print ''; From 0fd7d517bee448c899036fe3b77f054e3e980693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lina=20JOUM?= Date: Wed, 22 Jan 2025 11:40:59 +0100 Subject: [PATCH 2/2] FIX: Allow import and export with the PRODUCT_CUSTOMER_PRICES_AND_MULTIPRICES option --- htdocs/core/modules/modProduct.class.php | 4 ++-- htdocs/core/modules/modService.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 7b87d30b1f4..7b5ae32f69a 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -335,7 +335,7 @@ class modProduct extends DolibarrModules $this->export_sql_order[$r] = ' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields" } - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Exports product multiprice $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; @@ -905,7 +905,7 @@ class modProduct extends DolibarrModules $this->import_updatekeys_array[$r] = array('sp.fk_product' => 'ProductOrService', 'sp.ref_fourn' => 'SupplierRef', 'sp.fk_soc' => 'Supplier', 'sp.quantity' => "QtyMin"); } - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Import products multiprices $r++; $this->import_code[$r] = $this->rights_class.'_multiprice'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 7501cebf241..ea16a72ff63 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -285,7 +285,7 @@ class modService extends DolibarrModules } if (!isModEnabled("product")) { // We enable next import templates only if module product not already enabled (to avoid duplicate entries) - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Exports product multiprice $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; @@ -801,7 +801,7 @@ class modService extends DolibarrModules $this->import_updatekeys_array[$r] = array('sp.fk_product' => 'ProductOrService', 'sp.ref_fourn' => 'SupplierRef', 'sp.fk_soc' => 'Supplier'); } - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Import products multiprices $r++; $this->import_code[$r] = $this->rights_class.'_multiprice';