From efbb053e54fffa154a7ed515a54ee12c946b4d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 23 May 2018 17:05:08 +0200 Subject: [PATCH] PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES --- htdocs/comm/card.php | 2 +- htdocs/comm/propal/card.php | 23 ++++++++- htdocs/commande/card.php | 26 ++++++++-- htdocs/compta/facture/card.php | 25 +++++++++- htdocs/core/class/html.form.class.php | 9 ++-- htdocs/product/admin/product.php | 6 +-- htdocs/product/class/product.class.php | 68 +++++++++++++++++++++++++- htdocs/product/price.php | 41 ++++++++-------- 8 files changed, 164 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index eee4d529751..f74f9d777e8 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -436,7 +436,7 @@ if ($object->id > 0) // Multiprice level - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; print ''."\n"; */ $rowspan = 4; -if (! empty($conf->global->PRODUIT_MULTIPRICES)) $rowspan++; +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $rowspan++; if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) $rowspan++; if (! empty($conf->global->MAIN_MULTILANGS)) $rowspan++; @@ -553,7 +553,7 @@ $current_rule = 'PRODUCT_PRICE_UNIQ'; if (!empty($conf->global->PRODUIT_MULTIPRICES)) $current_rule='PRODUIT_MULTIPRICES'; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY'; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES'; -if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) && (!empty($conf->global->PRODUIT_MULTIPRICES))) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; +if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $current_rule='PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'; print $form->selectarray("princingrule",$select_pricing_rules,$current_rule); if ( empty($conf->multicompany->enabled)) { @@ -566,7 +566,7 @@ print ''; // multiprix nombre de prix a proposer -if (! empty($conf->global->PRODUIT_MULTIPRICES)) +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f36fd59035..291182ba475 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1665,7 +1665,7 @@ class Product extends CommonObject // If multiprices are enabled, then we check if the current product is subject to price autogeneration // Price will be modified ONLY when the first one is the one that is being modified - if (!empty($conf->global->PRODUIT_MULTIPRICES) && !$ignore_autogen && $this->price_autogen && ($level == 1)) + if ((!empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !$ignore_autogen && $this->price_autogen && ($level == 1)) { return $this->generateMultiprices($user, $newprice, $newpricebase, $newvat, $newnpr, $newpbq); } @@ -2088,7 +2088,71 @@ class Product extends CommonObject } else if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // prices per customer and quantity { - // Not yet implemented + for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) + { + $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; + $sql.= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; + $sql.= " WHERE entity IN (".getEntity('productprice').")"; + $sql.= " AND price_level=".$i; + $sql.= " AND fk_product = ".$this->id; + $sql.= " ORDER BY date_price DESC, rowid DESC"; + $sql.= " LIMIT 1"; + $resql = $this->db->query($sql); + if ($resql) + { + $result = $this->db->fetch_array($resql); + + $this->multiprices[$i]=$result["price"]; + $this->multiprices_ttc[$i]=$result["price_ttc"]; + $this->multiprices_min[$i]=$result["price_min"]; + $this->multiprices_min_ttc[$i]=$result["price_min_ttc"]; + $this->multiprices_base_type[$i]=$result["price_base_type"]; + // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on + $this->multiprices_tva_tx[$i]=$result["tva_tx"]; // TODO Add ' ('.$result['default_vat_code'].')' + $this->multiprices_recuperableonly[$i]=$result["recuperableonly"]; + + // Price by quantity + $this->prices_by_qty[$i]=$result["price_by_qty"]; + $this->prices_by_qty_id[$i]=$result["rowid"]; + // Récuperation de la liste des prix selon qty si flag positionné + if ($this->prices_by_qty[$i] == 1) + { + $sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; + $sql.= " WHERE fk_product_price = ".$this->prices_by_qty_id[$i]; + $sql.= " ORDER BY quantity ASC"; + $resultat=array(); + $resql = $this->db->query($sql); + if ($resql) + { + $ii=0; + while ($result= $this->db->fetch_array($resql)) { + $resultat[$ii]=array(); + $resultat[$ii]["rowid"]=$result["rowid"]; + $resultat[$ii]["price"]= $result["price"]; + $resultat[$ii]["unitprice"]= $result["unitprice"]; + $resultat[$ii]["quantity"]= $result["quantity"]; + $resultat[$ii]["remise_percent"]= $result["remise_percent"]; + $resultat[$ii]["remise"]= $result["remise"]; // deprecated + $resultat[$ii]["price_base_type"]= $result["price_base_type"]; + $ii++; + } + $this->prices_by_qty_list[$i]=$resultat; + } + else + { + dol_print_error($this->db); + return -1; + } + } + } + else + { + dol_print_error($this->db); + return -1; + } + } } if (!empty($conf->dynamicprices->enabled) && !empty($this->fk_price_expression) && empty($ignore_expression)) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 61b6316ca01..672eede5552 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -72,7 +72,7 @@ if ($id > 0 || ! empty($ref)) } // Clean param -if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; +if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && empty($conf->global->PRODUIT_MULTIPRICES_LIMIT)) $conf->global->PRODUIT_MULTIPRICES_LIMIT = 5; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productpricecard','globalcard')); @@ -202,7 +202,7 @@ if (empty($reshook)) } // Multiprices - if (! $error && ! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! $error && (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $newprice = GETPOST('price', 'array'); $newprice_min = GETPOST('price_min', 'array'); @@ -717,7 +717,7 @@ print '
'; print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 004b32a83fc..a2f4dcd1f5d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -848,7 +848,28 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 76a290a79cd..075f174e355 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -797,7 +797,27 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); @@ -1018,8 +1038,8 @@ if (empty($reshook)) $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) - $price_min = $product->multiprices_min [$object->thirdparty->price_level]; + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min[$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dbce9c2e76d..a9769c04442 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1729,7 +1729,28 @@ if (empty($reshook)) // If price per quantity and customer elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - // TODO Same than PRODUIT_CUSTOMER_PRICES_BY_QTY but using $object->thirdparty->price_level + if ($prod->prices_by_qty[$object->thirdparty->price_level]) // yes, this product has some prices per quantity + { + // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. + $pqp = GETPOST('pbq','int'); + + // Search price into product_price_by_qty from $prod->id + foreach($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) + { + if ($priceforthequantityarray['rowid'] != $pqp) continue; + // We found the price + if ($priceforthequantityarray['price_base_type'] == 'HT') + { + $pu_ht = $priceforthequantityarray['unitprice']; + } + else + { + $pu_ttc = $priceforthequantityarray['unitprice']; + } + // Note: the remise_percent or price by qty is used to set data on form, so we will use value from POST. + break; + } + } } $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); @@ -1978,7 +1999,7 @@ if (empty($reshook)) $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($object->thirdparty->price_level)) $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c02ada175fd..dddb5201f06 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1942,7 +1942,7 @@ class Form $selectFields.= ", label_translated"; } // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { $sql.= ", (SELECT pp.rowid FROM ".MAIN_DB_PREFIX."product_price as pp WHERE pp.fk_product = p.rowid"; if ($price_level >= 1 && !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) $sql.= " AND price_level=".$price_level; @@ -2063,7 +2063,7 @@ class Form $optJson = array(); $objp = $this->db->fetch_object($result); - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) + if ((!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; @@ -2212,7 +2212,8 @@ class Form $found=0; // Multiprice - if (empty($hidepriceinlabel) && $price_level >= 1 && $conf->global->PRODUIT_MULTIPRICES) // If we need a particular price level (from 1 to 6) + // If we need a particular price level (from 1 to 6) + if (empty($hidepriceinlabel) && $price_level >= 1 && (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; @@ -2253,7 +2254,7 @@ class Form } // Price by quantity - if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1 && (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { $found = 1; $outqty=$objp->quantity; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 3ff76dd1f82..63f10296212 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -541,7 +541,7 @@ print ' 
'; // Price per customer segment/level -if (! empty($conf->global->PRODUIT_MULTIPRICES)) +if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { // Price and min price are variable (depends on level of company). if (! empty($socid)) @@ -880,10 +880,11 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // TODO Fix the form included into a tr instead of a td + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // TODO Fix the form included into a tr instead of a td { print '
' . $langs->trans("PriceByQuantity") . ' ' . $i; - print ''; + if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + print ''; if ($object->prices_by_qty[$i] == 1) { print ''; @@ -935,9 +936,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; // id in product_price print ''; print ''; - print ''; - // print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -991,7 +992,7 @@ else print ''; // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // TODO Fix the form inside tr instead of td + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // TODO Fix the form inside tr instead of td { print ''; print ''; - if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; } - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; } print ''; print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) print ''; print ''; print ''; if (! empty($conf->dynamicprices->enabled)) { @@ -1502,11 +1503,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print ""; // Price level - if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print '"; } // Price by quantity - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { $type = ($objp->price_by_qty == 1) ? 'PriceByQuantity' : 'Standard'; print '"; @@ -1518,7 +1519,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ } print ""; - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print '
 ' . $object->price_base_type . '  % ' . $object->price_base_type . '  %
' . $langs->trans("PriceByQuantity"); if ($object->prices_by_qty[0] == 0) { @@ -1108,7 +1109,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ { print "\n" . '
' . "\n"; - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; @@ -1122,7 +1123,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $ } } - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; @@ -1177,7 +1178,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print load_fiche_titre($langs->trans("NewPrice"), ''); - if (empty($conf->global->PRODUIT_MULTIPRICES)) + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''."\n"; print '
'; @@ -1322,7 +1323,7 @@ if ($action == 'edit_price' && $object->getRights()->creer) //dol_fiche_head('', '', '', -1); - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) { + if ((! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) && ! empty($conf->global->PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL)) { print $langs->trans('UseMultipriceRules'). ' price_autogen ? 'checked' : '').'>

'; } @@ -1468,16 +1469,16 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ print '
' . $langs->trans("AppliedPricesFrom") . '' . $langs->trans("PriceLevel") . '' . $langs->trans("Type") . '' . $langs->trans("PriceBase") . '' . $langs->trans("DefaultTaxRate") . '' . $langs->trans("DefaultTaxRate") . '' . $langs->trans("HT") . '' . $langs->trans("TTC") . '" . dol_print_date($db->jdate($objp->dp), "dayhour") . "' . $objp->price_level . "' . $langs->trans($type) . "'; @@ -1586,7 +1587,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_ if ($user->rights->produit->supprimer) { $candelete=0; - if (! empty($conf->global->PRODUIT_MULTIPRICES)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if (empty($notfirstlineforlevel[$objp->price_level])) $notfirstlineforlevel[$objp->price_level]=1; else $candelete=1;