diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 340b30ffc9a..5d82fb4d628 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -18,15 +18,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/product/price.php \ingroup product \brief Page de la fiche produit - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -45,7 +43,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 +85,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 +144,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 +176,7 @@ print $product->getLibStatut(2); print ''; print "\n"; - + print "\n"; @@ -208,10 +206,7 @@ if (! $_GET["action"]) */ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) { - $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); + print_fiche_titre($langs->trans("NewPrice")); if (! $conf->global->PRODUIT_MULTIPRICES) { @@ -220,7 +215,8 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) print ''; print ''; print ''; if ($product->price_base_type == 'TTC') @@ -241,41 +237,35 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) } else { - - print ''; - print ''; - - for ( $i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++ ) { - - print ''; - print '
'; - print $langs->trans('SellingPrice'); + $text=$langs->trans('SellingPrice'); + print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); 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 ''; - + for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) + { + print '
'; + print ''; + print ''; + 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 '
'; + } } - + } @@ -326,12 +316,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").''; @@ -347,7 +337,7 @@ if ($result) print ""; // Date print "".dolibarr_print_date($objp->dp,"dayhour").""; - + // catégorie de Prix if ($conf->global->PRODUIT_MULTIPRICES) {