diff --git a/htdocs/product/price.php b/htdocs/product/price.php index ffdb6ab3f43..340b30ffc9a 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -45,7 +45,7 @@ accessforbidden(); * Actions */ -if ($_POST["action"] == 'update_price' && +if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && $user->rights->produit->creer) { $product = new Product($db); @@ -87,7 +87,7 @@ if ($_POST["action"] == 'update_price' && $newprice=price2num($_POST["price"],'MU'); $newpricebase=$_POST["price_base_type"]; } - + if ($product->update_price($product->id, $newprice, $newpricebase, $user) > 0) { $_GET["action"] = ''; @@ -146,7 +146,7 @@ if($conf->global->PRODUIT_MULTIPRICES) { print ''.price($product->multiprices["$i"]); } - + if ($product->multiprices_base_type["$i"]) { print ' '.$langs->trans($product->multiprices_base_type["$i"]); @@ -178,7 +178,7 @@ print $product->getLibStatut(2); print ''; print "\n"; - + print "\n"; @@ -208,7 +208,10 @@ if (! $_GET["action"]) */ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) { - print_fiche_titre($langs->trans("NewPrice")); + $texte = $langs->trans("NewPrice"); + $titre = $html->textwithhelp($texte, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), $direction=1, $usehelpcursor=1); + + print_fiche_titre($titre); if (! $conf->global->PRODUIT_MULTIPRICES) { @@ -217,8 +220,7 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) print ''; print ''; print ''; if ($product->price_base_type == 'TTC') @@ -239,35 +241,41 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) } else { - for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) - { - print ''; - print ''; - print ''; - print '
'; - $text=$langs->trans('SellingPrice'); - print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); + print $langs->trans('SellingPrice'); print '
'; - print ''; - - if ($product->multiprices_base_type["$i"] == 'TTC') - { - print ''; - print ''; - print '
'; - $text=$langs->trans('SellingPrice').' '.$i; - print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); - print ''; - } - else - { - print ''; - } - - print $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i); - print '
 '; - print '
'; - print ''; - } + + print '
'; + print ''; + + for ( $i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++ ) { + + print ''; + print ''; + print ''; + + if ($product->multiprices_base_type["$i"] == 'TTC') { + + print ''; + + } + + print ''; + print '
'; + + print ( $langs->trans('SellingPrice').' '.$i ); + print ''; + + } else { + + print ''; + + } + + print $html->select_PriceBaseType($product->multiprices_base_type["$i"], "multiprices_base_type_".$i); + print '
 '; + print '
'; + print '
'; + } - + } @@ -318,12 +326,12 @@ if ($result) print ''; print ''.$langs->trans("AppliedPricesFrom").''; - + if($conf->global->PRODUIT_MULTIPRICES) { print ''.$langs->trans("MultiPriceLevelsName").''; } - + print ''.$langs->trans("HT").''; print ''.$langs->trans("TTC").''; print ''.$langs->trans("PriceBase").''; @@ -339,7 +347,7 @@ if ($result) print ""; // Date print "".dolibarr_print_date($objp->dp,"dayhour").""; - + // catégorie de Prix if ($conf->global->PRODUIT_MULTIPRICES) {