diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 11e0ddcb00b..9e8d6d2197e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -125,4 +125,5 @@ Category=Categorie From=From to=to Quantity=Quantity -Qty=Qty \ No newline at end of file +Qty=Qty +ChangedBy=Changed by \ No newline at end of file diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 4d0d4b6b9d3..06b29275701 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -20,4 +20,8 @@ CardProduct1=Service card Stock=Stock Stocks=Stocks OnSell=On sell -NotOnSell=Out of Sell \ No newline at end of file +NotOnSell=Out of Sell +UpdatePrice=Update price +AppliedPricesFrom=Applied prices from +SellingPrice=Selling price +NewPrice=New price \ No newline at end of file diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index da4685fe49f..7dbd40a0d38 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -126,3 +126,4 @@ From=Du to=au Quantity=Quantité Qty=Qté +ChangedBy=Modifié par diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index b93dce69bb0..7556607ecd2 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -21,3 +21,7 @@ Stock=Stock Stocks=Stocks OnSell=En vente NotOnSell=Hors vente +UpdatePrice=Changer le prix +AppliedPricesFrom=Prix de vente pratiqués à partir du +SellingPrice=Prix de vente +NewPrice=Nouveau prix diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index ee4ac427823..f2e68a89be8 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -132,12 +132,13 @@ if ($_POST["action"] == 'addinpropal') $result = $propal->insert_product($_GET["id"], $_POST["qty"], $_POST["remise_percent"]); if ( $result < 0) { - $mesg = "erreur $result"; + $mesg = $langs->trans("ErrorUnknown").": $result"; } Header("Location: ../comm/propal.php?propalid=".$propal->id); } + if ($_POST["action"] == 'addinfacture' && ( $user->rights->facture->modifier || $user->rights->facture->creer)) { @@ -286,10 +287,10 @@ if ($_GET["action"] == 'create') if ($_GET["type"] == 1) { print ''.$langs->trans("Duration").'  '; - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; + print ''.$langs->trans("Day").' '; + print ''.$langs->trans("Week").' '; + print ''.$langs->trans("Month").' '; + print ''.$langs->trans("Year").' '; print ''; } @@ -320,8 +321,8 @@ else print '
'; print '
'; print ''; - print $langs->trans("Ref").':    '; - print $langs->trans("Label").':  '; + print $langs->trans("Ref").':    '; + print $langs->trans("Label").':  '; print '
'; $h=0; @@ -351,7 +352,7 @@ else print($mesg); - print ''; + print '
'; print ""; print ''; print '
'.$langs->trans("Ref").''.$product->ref.''; @@ -376,7 +377,7 @@ else } print ''; - print 'Fournisseurs [Ajouter]'; + print $langs->trans("Suppliers").' ['.$langs->trans("Add").']'; $sql = "SELECT s.nom, s.idp"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; @@ -387,7 +388,7 @@ else { $num = $db->num_rows(); $i = 0; - print ''; + print '
'; $var=True; while ($i < $num) { @@ -433,25 +434,16 @@ else if ($product->type == 1) { print ''; } print "
'.$langs->trans("Duration").''.$product->duration_value.' '; + if ($product->duration_value > 1) - { - $plu = "s"; - } - switch ($product->duration_unit) - { - case "d": - print "jour$plu "; - break; - case "w": - print "semaine$plu "; - break; - case "m": - print 'mois '; - break; - case "y": - print "an$plu "; - break; - } + { + $dur=array("d"=>"Days","w","Weeks","m","Months","y"=>"Years"); + } + else { + $dur=array("d"=>"Day","w","Week","m","Month","y"=>"Year"); + } + print $langs->trans($dur[$product->duration_unit])." "; + print '

\n"; @@ -466,12 +458,12 @@ else */ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) { - print '
Nouveau prix
'; + print '
'.$langs->trans("NewPrice").'
'; print '
'; print ''; print ''; - print ''; - print ''; + print '
Prix de vente
'; + print ''; print ''; print '
'.$langs->trans('SellingPrice').'
 '; print '
'; @@ -488,8 +480,8 @@ else print ''; print ''; print ''; - print ''; - print '
Fournisseurs'; + print '
'.$langs->trans("Suppliers").''; print ''; - print ''; + print '
'; print "".''; print ''; @@ -541,13 +533,13 @@ else print ''; } - print "".''; print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Duration").''; - switch ($product->duration_unit) - { - case "d": - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - break; - case "w": - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - break; - case "m": - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - break; - case "y": - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - break; - default: - print 'jour '; - print 'semaine '; - print 'mois '; - print 'année'; - break; - } + + print 'duration_unit=='d'?' checked':'').'>jour '; + print 'duration_unit=='w'?' checked':'').'>semaine '; + print 'duration_unit=='m'?' checked':'').'>mois '; + print 'duration_unit=='y'?' checked':'').'>année'; + print '
 '; + print '
 '; print '
'; print ''; @@ -612,7 +577,7 @@ else } else { - print "Error"; + print $langs->trans("ErrorUnknown"); } } @@ -628,7 +593,7 @@ if ($_GET["action"] == '') { if ($user->rights->produit->modifier || $user->rights->produit->creer) { - print 'Changer le prix'; + print ''.$langs->trans("UpdatePrice").''; } } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 82cd1616257..e620e1df167 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -63,8 +63,8 @@ $result = $product->fetch($_GET["id"]); print '
'; print '
'; print ''; -print $langs->trans("Ref").':    '; -print $langs->trans("Label").':  '; +print $langs->trans("Ref").':    '; +print $langs->trans("Label").':  '; print '
'; @@ -94,9 +94,10 @@ $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); -$sql = "SELECT p.rowid, p.price, ".$db->pdate("p.date_price")." as dp"; -$sql .= " FROM ".MAIN_DB_PREFIX."product_price as p"; +$sql = "SELECT p.rowid, p.price, ".$db->pdate("p.date_price")." as dp, u.login"; +$sql .= " FROM ".MAIN_DB_PREFIX."product_price as p, llx_user as u"; $sql .= " WHERE fk_product = ".$product->id; +$sql .= " AND p.fk_user_author = u.rowid "; $sql .= " ORDER BY p.date_price DESC "; $sql .= $db->plimit(15 ,0); $result = $db->query($sql) ; @@ -109,9 +110,13 @@ if ($result) if ($num > 0) { - print ''; + print '
'; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; $var=True; while ($i < $num) @@ -119,8 +124,9 @@ if ($result) $objp = $db->fetch_object( $i); $var=!$var; print ""; - print ""; + print ""; print ""; + print ""; print "\n"; $i++; @@ -132,11 +138,32 @@ if ($result) } else { - print $db->error() . "
" .$sql; + dolibarr_print_error($db); } print "\n"; + + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print "\n
\n"; + +if ($_GET["action"] == '') +{ + if ($user->rights->produit->modifier || $user->rights->produit->creer) + { + print ''.$langs->trans("UpdatePrice").''; + } +} + +print "\n
\n"; + + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$");
Prix de vente pratiqués
'.$langs->trans("AppliedPricesFrom").''.$langs->trans("Price").''.$langs->trans("ChangedBy").'
".strftime("%d %B %Y %H:%M:%S",$objp->dp)."".dolibarr_print_date($objp->dp,"%d %B %Y %H:%M:%S")."".price($objp->price)."".$objp->login."