PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES

This commit is contained in:
Frédéric FRANCE 2018-05-23 17:05:08 +02:00
parent f50a6149d5
commit efbb053e54
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
8 changed files with 164 additions and 36 deletions

View File

@ -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 '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';

View File

@ -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));

View File

@ -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') : '');

View File

@ -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') : '');

View File

@ -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;

View File

@ -541,7 +541,7 @@ print '<td width="80">&nbsp;</td></tr>'."\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 '</tr>';
// 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 '<tr class="oddeven">';

View File

@ -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))

View File

@ -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 '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// 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 '</td></tr>';
// 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 '<tr><td>' . $langs->trans("PriceByQuantity") . ' ' . $i;
print '</td><td>';
if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel);
print '</td><td colspan="2">';
if ($object->prices_by_qty[$i] == 1) {
print '<table width="50%" class="border" summary="List of quantities">';
@ -935,9 +936,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
print '<input type="hidden" value="0" name="rowid">'; // id in product_price
print '<tr class="' . ($ii % 2 == 0 ? 'pair' : 'impair') . '">';
print '<td><input size="5" type="text" value="1" name="quantity"></td>';
print '<td align="right" colspan="2"><input size="10" type="text" value="0" name="price">&nbsp;' . $object->price_base_type . '</td>';
// print '<td align="right">&nbsp;</td>';
print '<td align="right"><input size="5" type="text" value="0" name="remise_percent">&nbsp;%</td>';
print '<td align="right" class="nowrap"><input size="10" type="text" value="0" name="price">&nbsp;' . $object->price_base_type . '</td>';
print '<td align="right">&nbsp;</td>';
print '<td align="right" class="nowrap"><input size="5" type="text" value="0" name="remise_percent">&nbsp;%</td>';
print '<td align="center"><input type="submit" value="' . $langs->trans("Add") . '" class="button"></td>';
print '</tr>';
print '</form>';
@ -991,7 +992,7 @@ else
print '</td></tr>';
// 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 '<tr><td>' . $langs->trans("PriceByQuantity");
if ($object->prices_by_qty[0] == 0) {
@ -1108,7 +1109,7 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $
{
print "\n" . '<div class="tabsAction">' . "\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 '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&amp;id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
@ -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 '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_vat&amp;id=' . $object->id . '">' . $langs->trans("UpdateVAT") . '</a></div>';
@ -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 '<!-- Edit price -->'."\n";
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
@ -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'). ' <input type="checkbox" id="usePriceRules" name="usePriceRules" '.($object->price_autogen ? 'checked' : '').'><br><br>';
}
@ -1468,16 +1469,16 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
print '<td align="center">' . $langs->trans("PriceLevel") . '</td>';
}
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 '<td align="center">' . $langs->trans("Type") . '</td>';
}
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL;
if (empty($conf->global->PRODUIT_MULTIPRICES)) print '<td align="right">' . $langs->trans("DefaultTaxRate") . '</td>';
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) print '<td align="right">' . $langs->trans("DefaultTaxRate") . '</td>';
print '<td align="right">' . $langs->trans("HT") . '</td>';
print '<td align="right">' . $langs->trans("TTC") . '</td>';
if (! empty($conf->dynamicprices->enabled)) {
@ -1502,11 +1503,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
print "<td>" . dol_print_date($db->jdate($objp->dp), "dayhour") . "</td>";
// Price level
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
print '<td align="center">' . $objp->price_level . "</td>";
}
// 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 '<td align="center">' . $langs->trans($type) . "</td>";
@ -1518,7 +1519,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action=='showlog_default_
}
print "</td>";
if (empty($conf->global->PRODUIT_MULTIPRICES))
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
{
print '<td align="right">';
@ -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;