diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 71ada686b4f..770fea5e554 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -77,6 +77,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) $product->ref = $_POST["ref"]; $product->libelle = $_POST["libelle"]; $product->price = $_POST["price"]; + $product->price_base_type = $_POST["price_base_type"]; $product->tva_tx = $_POST["tva_tx"]; $product->type = $_POST["type"]; $product->status = $_POST["statut"]; @@ -90,15 +91,22 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) $product->new_weight_units = $_POST["weight_units"]; // MultiPrix if($conf->global->PRODUIT_MULTIPRICES == 1) - { - for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) - { - if($_POST["price_".$i]) - $product->multiprices["$i"]=ereg_replace(" ","",$_POST["price_".$i]); - else - $product->multiprices["$i"] = ""; - } - } + { + for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) + { + if($_POST["price_".$i]) + { + $price = ereg_replace(" ","", $_POST["price_".$i]); + $price = ereg_replace(",",".", $price); + $product->multiprices["$i"] = $price; + $product->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i]; + } + else + { + $product->multiprices["$i"] = ""; + } + } + } if ( $value != $current_lang ) $e_product = $product; @@ -132,7 +140,7 @@ if ($_POST["action"] == 'update' && $product->ref = $_POST["ref"]; $product->libelle = $_POST["libelle"]; if ( isset( $_POST["price"] ) ) - $product->price = $_POST["price"]; + $product->price = $_POST["price"]; $product->tva_tx = $_POST["tva_tx"]; $product->description = $_POST["desc"]; $product->note = $_POST["note"]; @@ -443,18 +451,27 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''.$langs->trans("Label").''; if($conf->global->PRODUIT_MULTIPRICES == 1) - { - print ''.$langs->trans("SellingPrice").' 1'; - for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) { - print ''.$langs->trans("SellingPrice").' '.$i.''; + print ''.$langs->trans("SellingPrice").' 1'; + print ''; + print $html->select_PriceBaseType($product->price_base_type, "price_base_type"); + print ''; + for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) + { + print ''.$langs->trans("SellingPrice").' '.$i.''; + print ''; + print $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i); + print ''; + } } - } - // PRIX + // PRIX else - { - print ''.$langs->trans("SellingPrice").''; - } + { + print ''.$langs->trans("SellingPrice").''; + print ''; + print $html->select_PriceBaseType($product->price_base_type, "price_base_type"); + print ''; + } print ''.$langs->trans("VATRate").''; print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,''); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index bd71fe29a42..15545c09a41 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -69,7 +69,6 @@ if ($_POST["action"] == 'update_price' && { $price = ereg_replace(" ","", $_POST["price_".$i]); $price = ereg_replace(",",".", $price); - //$product->SetSellprice($_POST["price_".$i], $_POST["price_base_type_".$i], $i); $product->multiprices["$i"] = $price; $product->multiprices_base_type["$i"] = $_POST["multiprices_base_type_".$i]; }