Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer price and level price #31091

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion htdocs/comm/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@


// Multiprice level
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 '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("PriceLevel");
Expand Down
51 changes: 47 additions & 4 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,51 @@
$price_min_ttc = $prod->price_min_ttc;
$price_base_type = $prod->price_base_type;

// If price per segment
if (getDolGlobalString('PRODUIT_MULTIPRICES') && $object->thirdparty->price_level) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// If price per customer
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
$prodcustprice = new ProductCustomerPrice($db);
$filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id);

// If a price per customer exist
$pricebycustomerexist = false;
$result = $prodcustprice->fetchAll('', '', 0, 0, $filter);
if ($result) {
// If there is some prices specific to the customer
if (count($prodcustprice->lines) > 0) {
$pricebycustomerexist = true;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_min = price($prodcustprice->lines[0]->price_min);
$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
$tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
}
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) {
$tva_npr = 0;
}*/
}
}

if ( !$pricebycustomerexist && $object->thirdparty->price_level) { // If price per segment
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
$price_min_ttc = $prod->multiprices_min_ttc[$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) {
$tva_tx = $prod->multiprices_tva_tx[$object->thirdparty->price_level];
}
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) {
$tva_npr = $prod->multiprices_recuperableonly[$object->thirdparty->price_level];
}
}
}
} elseif (getDolGlobalString('PRODUIT_MULTIPRICES') && $object->thirdparty->price_level) { // If price per segment
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
Expand Down Expand Up @@ -1549,11 +1592,11 @@
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');

$price_min = $product->price_min;
if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($object->thirdparty->price_level)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
$price_min = $product->multiprices_min[$object->thirdparty->price_level];
}
$price_min_ttc = $product->price_min_ttc;
if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($object->thirdparty->price_level)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
$price_min_ttc = $product->multiprices_min_ttc[$object->thirdparty->price_level];
}

Expand Down
52 changes: 50 additions & 2 deletions htdocs/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,54 @@
$price_min_ttc = $prod->price_min_ttc;
$price_base_type = $prod->price_base_type;

if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// If price per customer
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';

$prodcustprice = new ProductCustomerPrice($db);

$filter = array('t.fk_product' => $prod->id, 't.fk_soc' => $object->thirdparty->id);

// If a price per customer exist
$pricebycustomerexist = false;
$result = $prodcustprice->fetchAll('', '', 0, 0, $filter);
if ($result >= 0) {
if (count($prodcustprice->lines) > 0) {
$pricebycustomerexist = true;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_min = price($prodcustprice->lines[0]->price_min);
$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
$tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
}
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) {
$tva_npr = 0;
}
}
} else {
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
}

if ( !$pricebycustomerexist && !empty($object->thirdparty->price_level)) { //// If price per segment
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
$price_min_ttc = $prod->multiprices_min_ttc[$object->thirdparty->price_level];
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) {
$tva_tx = $prod->multiprices_tva_tx[$object->thirdparty->price_level];
}
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) {
$tva_npr = $prod->multiprices_recuperableonly[$object->thirdparty->price_level];
}
}
}
}
// If price per segment
if (getDolGlobalString('PRODUIT_MULTIPRICES') && !empty($object->thirdparty->price_level)) {
$pu_ht = $prod->multiprices[$object->thirdparty->price_level];
Expand Down Expand Up @@ -1241,11 +1289,11 @@
$type = $product->type;

$price_min = $product->price_min;
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
$price_min = $product->multiprices_min[$object->thirdparty->price_level];
}
$price_min_ttc = $product->price_min_ttc;
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($object->thirdparty->price_level)) {
$price_min_ttc = $product->multiprices_min_ttc[$object->thirdparty->price_level];
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ public function fetch_thirdparty($force_thirdparty_id = 0)
$this->thirdparty = $thirdparty;

// Use first price level if level not defined for third party
if (getDolGlobalString('PRODUIT_MULTIPRICES') && empty($this->thirdparty->price_level)) {
if ((getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && empty($this->thirdparty->price_level)) {
$this->thirdparty->price_level = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/conf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ public function setValues($db)
$this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
}

if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
if ((!empty($this->global->PRODUIT_MULTIPRICES) || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
$this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
}

Expand Down
14 changes: 8 additions & 6 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,7 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi
}

//Price by customer
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
$sql .= ', pcp.rowid as idprodcustprice, pcp.price as custprice, pcp.price_ttc as custprice_ttc,';
$sql .= ' pcp.price_base_type as custprice_base_type, pcp.tva_tx as custtva_tx, pcp.default_vat_code as custdefault_vat_code, pcp.ref_customer as custref';
$selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref";
Expand Down Expand Up @@ -3007,7 +3007,7 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi
}

//Price by customer
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
$sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid";
}
// Units
Expand Down Expand Up @@ -3087,7 +3087,7 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi
if (getDolGlobalInt('MAIN_MULTILANGS')) {
$sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'";
}
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
$sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'";
}
if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) {
Expand Down Expand Up @@ -3223,7 +3223,9 @@ public function select_produits_list($selected = 0, $htmlname = 'productid', $fi
$objp->price_ttc = price2num($objp->price_ttc, 'MU');
}
}

if (getDolGlobalInt('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES') && !empty($objp->custprice)) {
$price_level = '';
}
$this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected, $hidepriceinlabel, $filterkey);
// Add new entry
// "key" value of json key array is used by jQuery automatically as selected value
Expand Down Expand Up @@ -3445,7 +3447,7 @@ protected function constructProductListOption(&$objp, &$opt, &$optJson, $price_l
$labeltoshowprice = '';
$labeltoshowhtmlprice = '';
// If we need a particular price level (from 1 to n)
if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) {
if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code";
$sql .= " FROM " . $this->db->prefix() . "product_price";
$sql .= " WHERE fk_product = " . ((int) $objp->rowid);
Expand Down Expand Up @@ -3516,7 +3518,7 @@ protected function constructProductListOption(&$objp, &$opt, &$optJson, $price_l
}

// Price by customer
if (empty($hidepriceinlabel) && getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (empty($hidepriceinlabel) && (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) {
if (!empty($objp->idprodcustprice)) {
$found = 1;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/company.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function societe_prepare_head(Societe $object)
$head[$h][2] = 'customer';
$h++;

if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
$langs->load("products");
// price
$head[$h][0] = DOL_URL_ROOT.'/societe/price.php?socid='.$object->id;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/lib/pdf.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$prodser = new Product($db);

if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
include_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
}
}
Expand Down Expand Up @@ -1687,7 +1687,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
} else {
$ref_prodserv = $prodser->ref; // Show local ref only

if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
$productCustomerPriceStatic = new ProductCustomerPrice($db);
$filter = array('fk_product' => $idprod, 'fk_soc' => $object->socid);

Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/products.lang
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,4 @@ AllowStockMovementVariantParentHelp=By default, a parent of a variant is a virtu
ConfirmSetToDraftInventory=Are you sure you want to go back to Draft status?<br>The quantities currently set in the inventory will be reset.
WarningLineProductNotToSell=Product or service "%s" is not to sell and was cloned
PriceLabel=Price label
PriceByCustomeAndMultiPricesAbility=Different prices for each customer + Multiple price segments per product/service (each customer is in one price segment)
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/products.lang
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,4 @@ AllowStockMovementVariantParentHelp=Par défaut, un parent d'une variante est un
ConfirmSetToDraftInventory=Êtes-vous sûr de vouloir revenir à l'état de brouillon ?<br>Les quantités actuellement définies dans l'inventaire seront réinitialisées.
WarningLineProductNotToSell=Le produit ou le service "%s" n'est pas à vendre et a été cloné.
PriceLabel=Libellé du prix
PriceByCustomeAndMultiPricesAbility=Prix différents pour chaque client + Plusieurs niveaux de prix par produit/service (chaque client est dans un et un seul niveau)
5 changes: 5 additions & 0 deletions htdocs/product/admin/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'PRODUCT_PRICE_UNIQ' => $langs->trans('PriceCatalogue'), // Unique price
'PRODUIT_MULTIPRICES' => $langs->trans('MultiPricesAbility'), // Several prices according to a customer level
'PRODUIT_CUSTOMER_PRICES' => $langs->trans('PriceByCustomer'), // Different price for each customer
'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'=>$langs->trans('PriceByCustomeAndMultiPricesAbility'), // Different price for each customer and several prices according to a customer level
);
$keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || getDolGlobalString($keyforparam)) {
Expand Down Expand Up @@ -113,6 +114,7 @@
$res = dolibarr_set_const($db, 'PRODUIT_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0, 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'PRODUCT_PRICE_UNIQ', 1, 'chaine', 0, '', $conf->entity);
} else {
$multirule = explode('&', $princingrules);
Expand Down Expand Up @@ -587,6 +589,9 @@
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
$current_rule = 'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES';
}
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
$current_rule = 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES';
}
print $form->selectarray("princingrule", $select_pricing_rules, $current_rule, 0, 0, 0, '', 1, 0, 0, '', 'maxwidth400', 1);
print '</td>';
print '</tr>';
Expand Down
8 changes: 4 additions & 4 deletions htdocs/product/ajax/products.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
if (getDolGlobalInt('MAIN_MULTILANGS') && getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) {
$needchangeaccordingtothirdparty = 1;
}
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')) {
$needchangeaccordingtothirdparty = 1;
}
if ($needchangeaccordingtothirdparty) {
Expand All @@ -135,7 +135,7 @@
}

//Set price level according to thirdparty
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')) {
$price_level = $thirdpartytemp->price_level;
}
}
Expand Down Expand Up @@ -167,7 +167,7 @@
}

// Multiprice (1 price per level)
if (!$found && isset($price_level) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { // If we need a particular price level (from 1 to 6)
if (!$found && isset($price_level) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { // If we need a particular price level (from 1 to 6)
$sql = "SELECT price, price_ttc, price_base_type,";
$sql .= " tva_tx, default_vat_code"; // Vat rate and code will be used if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on.
$sql .= " FROM ".MAIN_DB_PREFIX."product_price ";
Expand Down Expand Up @@ -200,7 +200,7 @@
}

// Price by customer
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) {
if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';

$prodcustprice = new ProductCustomerPrice($db);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@
print '<hr>';

if (!getDolGlobalString('PRODUCT_DISABLE_PRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
// We do no show price array on create when multiprices enabled.
// We must set them on prices tab.
print '<table class="border centpercent">';
Expand Down
Loading
Loading