diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3599552b860..fb68e2e6472 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1203,7 +1203,7 @@ class Product extends CommonObject // Récuperation de la liste des prix selon qty si flag positionné if ($this->prices_by_qty[$i] == 1) { - $sql = "SELECT rowid,price, price_ttc,qty_min,qty_max"; + $sql = "SELECT rowid,price, price_ttc,qty_min"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[$i]."'"; $sql.= " ORDER BY qty_min ASC"; @@ -1218,7 +1218,6 @@ class Product extends CommonObject $resultat[$ii]["price"]= $result["price"]; $resultat[$ii]["price_ttc"]= $result["price_ttc"]; $resultat[$ii]["qty_min"]= $result["qty_min"]; - $resultat[$ii]["qty_max"]= $result["qty_max"]; $ii++; } $this->prices_by_qty_list[$i]=$resultat; @@ -1255,7 +1254,7 @@ class Product extends CommonObject // Récuperation de la liste des prix selon qty si flag positionné if ($this->prices_by_qty[0] == 1) { - $sql = "SELECT rowid,price, price_ttc,qty_min,qty_max"; + $sql = "SELECT rowid,price, price_ttc,qty_min"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[0]."'"; $sql.= " ORDER BY qty_min ASC"; @@ -1270,7 +1269,6 @@ class Product extends CommonObject $resultat[$ii]["price"]= $result["price"]; $resultat[$ii]["price_ttc"]= $result["price_ttc"]; $resultat[$ii]["qty_min"]= $result["qty_min"]; - $resultat[$ii]["qty_max"]= $result["qty_max"]; $ii++; } $this->prices_by_qty_list[0]=$resultat; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 079d83b5d74..2ff0a751e99 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -128,7 +128,6 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu $newprice=price2num(GETPOST("price"),'MU'); //$newminprice=price2num(GETPOST("price_min"),'MU'); // TODO : Add min price management and discount management $qtymin=GETPOST('qty_min'); - $qtymax=GETPOST('qty_max'); // Calcul des prix (HT et TTC) if ($newprice!='' || $newprice==0) @@ -177,14 +176,13 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu $sql = "UPDATE ".MAIN_DB_PREFIX."product_price_by_qty SET"; $sql.= " price='".$price."',"; $sql.= " price_ttc=".$price_ttc.","; - $sql.= " qty_min=".$qtymin.","; - $sql.= " qty_max=".$qtymax; + $sql.= " qty_min=".$qtymin; $sql.= " WHERE rowid = ".GETPOST('rowid'); $result = $db->query($sql); } else { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price_by_qty (fk_product_price,price,price_ttc,qty_min,qty_max) values ("; - $sql.= $priceid.','.$price.','.$price_ttc.','.$qtymin.','.$qtymax.')'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price_by_qty (fk_product_price,price,price_ttc,qty_min) values ("; + $sql.= $priceid.','.$price.','.$price_ttc.','.$qtymin.')'; $result = $db->query($sql); } @@ -338,35 +336,6 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print price($object->multiprices_min["$i"]).' '.$langs->trans($object->multiprices_base_type["$i"]); } print ''; - - // Price by quantity - /*if($conf->global->PRODUIT_PRICE_BY_QTY) { - print ''.$langs->trans("PriceByQuantity").' '.$i.''; - if($object->prices_by_qty[$i] == 1) { - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - foreach ($object->prices_by_qty_list[$i] as $j=> $prices) { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } - print '
'.$langs->trans("PriceByQuantityRange").''.$langs->trans("HT").''.$langs->trans("TTC").' 
'.$prices['qty_min'].' - '.$prices['qty_max'].''.price($prices['price']).''.price($prices['price_ttc']).''; - print img_delete(); - print '
'; - } else { - print $langs->trans("No"); - } - print ''; - }*/ // Price by quantity if($conf->global->PRODUIT_PRICE_BY_QTY) { @@ -389,8 +358,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; print ''; print ''; - print ' - '; - print ''; + print ''; print ' '.$object->price_base_type.''; print ' '; print ''; @@ -398,7 +366,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; } else { print ''; - print ''.$prices['qty_min'].' - '.$prices['qty_max'].''; + print ''.$prices['qty_min'].''; print ''.price($prices['price']).''; print ''.price($prices['price_ttc']).''; print ''; @@ -420,9 +388,8 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; print ''; print ''; - print ' - '; - print ''; - print ' '.$object->price_base_type.''; + print ''; + print ' '.$object->price_base_type.''; print ' '; print ''; print ''; @@ -491,8 +458,7 @@ else print ''; print ''; print ''; - print ' - '; - print ''; + print ''; print ' '.$object->price_base_type.''; print ' '; print ''; @@ -500,7 +466,7 @@ else print ''; } else { print ''; - print ''.$prices['qty_min'].' - '.$prices['qty_max'].''; + print ''.$prices['qty_min'].''; print ''.price($prices['price']).''; print ''.price($prices['price_ttc']).''; print ''; @@ -522,9 +488,8 @@ else print ''; print ''; print ''; - print ' - '; - print ''; - print ' '.$object->price_base_type.''; + print ''; + print ' '.$object->price_base_type.''; print ' '; print ''; print '';