diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 6c6fd033290..84ee121f6bf 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -419,7 +419,7 @@ class pdf_standard_stock extends ModelePDFStock $pricemin = 0; // Price sell min - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { $pricemin = $objp->price; $pdf->SetXY($this->posxdiscount, $curY); $pdf->MultiCell($this->postotalht - $this->posxdiscount, 3, price(price2num($pricemin, 'MU'), 0, $outputlangs), 0, 'R', false); @@ -512,7 +512,7 @@ class pdf_standard_stock extends ModelePDFStock $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 3, price(price2num($totalvalue, 'MT'), 0, $outputlangs), 0, 'R'); // Price sell min - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Total sell min $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($totalvaluesell, 'MT'), 0, $outputlangs), 0, 'R', false); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index a2df15f53fd..075dbea6a56 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -750,7 +750,7 @@ class Products extends DolibarrApi throw new RestException(403); } - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } @@ -796,7 +796,7 @@ class Products extends DolibarrApi throw new RestException(403); } - if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { + if (!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 38aca1ca8e9..60157c83fa4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2877,7 +2877,7 @@ class Product extends CommonObject // check if price have really change before log $newPriceData = $this->getArrayForPriceCompare($level); - if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || !getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { $this->_log_price($user, $level); // Save price for level into table product_price } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 5085eb02448..56993c98733 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -253,7 +253,7 @@ if ($id > 0 || !empty($ref)) { dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', ''); - if ($object->type != Product::TYPE_SERVICE || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || !getDolGlobalString('PRODUIT_MULTIPRICES')) { + if ($object->type != Product::TYPE_SERVICE || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { print '
| '; print price(price2num($pricemin, 'MU'), 1); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 8810fd59a85..0d5a331e1a8 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -845,7 +845,7 @@ while ($i < $imaxinloop) { // Selling value if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) { print ' | '; - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { if ($obj->sellvalue) { print ''.price(price2num($obj->sellvalue, 'MT'), 1).''; } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 3d4d38f60a9..e2aa8d6b7d7 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -750,7 +750,7 @@ if ($id > 0 || $ref) { } print ' | '; - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { // Price print '||||||||
| '.$langs->trans("SellingPrice").' | '; if ($usercancreadprice) { @@ -1328,7 +1328,7 @@ if ($showstockdetails) { print ' | '; if ($num) { print ''; - if (!getDolGlobalString('PRODUIT_MULTIPRICES') && $usercancreadprice) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES') && $usercancreadprice) { print price(price2num($totalvaluesell, 'MT'), 1); } else { print $form->textwithpicto('', $langs->trans("Variable")); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index b906879bb96..3694fecf712 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -695,7 +695,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { '"'.$objp->label.'"', '"'.price(price2num($stock, 'MS')).'"', price2num($stock * $objp->pmp, 'MT') ? '"'.price2num($stock * $objp->pmp, 'MT').'"' : '', - !getDolGlobalString('PRODUIT_MULTIPRICES') ? '"'.price2num($stock * $objp->price, 'MT').'"' : '"'.$langs->trans("Variable").'('.$langs->trans("OptionMULTIPRICESIsOn").')"', + (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) ? '"'.price2num($stock * $objp->price, 'MT').'"' : '"'.$langs->trans("Variable").'('.$langs->trans("OptionMULTIPRICESIsOn").')"', "$nbofmovement", '"'.price2num($currentstock, 'MS').'"'))."\r\n"; $totalbuyingprice += $stock * $objp->pmp; @@ -748,11 +748,11 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Selling value print ' | trans("Currently").'): '.price(price2num($objp->price, 'MU'), 1)); } print '">'; - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { print ''; if ($stock || (float) ($stock * $objp->price)) { print price(price2num($stock * $objp->price, 'MT'), 1); @@ -838,7 +838,7 @@ if ($ext == 'csv') { '', '', '"'.price2num($totalbuyingprice, 'MT').'"', - !getDolGlobalString('PRODUIT_MULTIPRICES') ? '"'.price2num($totalsellingprice, 'MT').'"' : '', + (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) ? '"'.price2num($totalsellingprice, 'MT').'"' : '', '', $productid > 0 ? price2num($totalcurrentstock, 'MS') : '') ); @@ -857,7 +857,7 @@ if ($ext == 'csv') { } else { print ' | '; print ' | '.price(price2num($totalbuyingprice, 'MT')).' | '; - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { print ''.price(price2num($totalsellingprice, 'MT')).' | '; } else { print ''; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index e1a543eeedd..26d96650d47 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -130,7 +130,7 @@ if ($result) { print ''; // Selling value print ' | '; - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { print price(price2num($objp->sellvalue, 'MT'), 1); } else { print $langs->trans("Variable"); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index defd9a52e21..a0b3fefa7c0 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -538,7 +538,7 @@ class Thirdparties extends DolibarrApi throw new RestException(501, 'Module "Products" needed for this request'); } - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { throw new RestException(501, 'Multiprices features activation needed for this request'); } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 6a77e684615..d1b5f4cda6d 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -169,7 +169,7 @@ if (($action == 'add' || $action == 'create') && $usercancreate && empty($massac $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { + if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { $level_price_impact = array(1 => $price_impact); $level_price_impact_percent = array(1 => $price_impact_percent); } @@ -723,7 +723,7 @@ if (!empty($id) || !empty($ref)) { | |