New: Ajout du login qui a modifi le prix dans l'affichage onglet prix.
Trad: Traduction des onglets prix et fiche produit.
This commit is contained in:
parent
12da4b65d6
commit
66daba1151
@ -125,4 +125,5 @@ Category=Categorie
|
||||
From=From
|
||||
to=to
|
||||
Quantity=Quantity
|
||||
Qty=Qty
|
||||
Qty=Qty
|
||||
ChangedBy=Changed by
|
||||
@ -20,4 +20,8 @@ CardProduct1=Service card
|
||||
Stock=Stock
|
||||
Stocks=Stocks
|
||||
OnSell=On sell
|
||||
NotOnSell=Out of Sell
|
||||
NotOnSell=Out of Sell
|
||||
UpdatePrice=Update price
|
||||
AppliedPricesFrom=Applied prices from
|
||||
SellingPrice=Selling price
|
||||
NewPrice=New price
|
||||
@ -126,3 +126,4 @@ From=Du
|
||||
to=au
|
||||
Quantity=Quantité
|
||||
Qty=Qté
|
||||
ChangedBy=Modifié par
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 '<tr><td>'.$langs->trans("Duration").'</td><td><input name="duration_value" size="6" maxlength="5" value="'.$product->duree.'"> ';
|
||||
print '<input name="duration_unit" type="radio" value="d">jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w">semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m">mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y">année';
|
||||
print '<input name="duration_unit" type="radio" value="d">'.$langs->trans("Day").' ';
|
||||
print '<input name="duration_unit" type="radio" value="w">'.$langs->trans("Week").' ';
|
||||
print '<input name="duration_unit" type="radio" value="m">'.$langs->trans("Month").' ';
|
||||
print '<input name="duration_unit" type="radio" value="y">'.$langs->trans("Year").' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -320,8 +321,8 @@ else
|
||||
print '<div class="formsearch">';
|
||||
print '<form action="liste.php" method="post">';
|
||||
print '<input type="hidden" name="type" value="'.$product->type.'">';
|
||||
print $langs->trans("Ref").': <input class="flat" type="text" size="10" name="sref"> <input class="flat" type="submit" value="go"> ';
|
||||
print $langs->trans("Label").': <input class="flat" type="text" size="20" name="snom"> <input class="flat" type="submit" value="go">';
|
||||
print $langs->trans("Ref").': <input class="flat" type="text" size="10" name="sref"> <input class="flat" type="submit" value="'.$langs->trans("Go").'"> ';
|
||||
print $langs->trans("Label").': <input class="flat" type="text" size="20" name="snom"> <input class="flat" type="submit" value="'.$langs->trans("Go").'">';
|
||||
print '</form></div>';
|
||||
|
||||
$h=0;
|
||||
@ -351,7 +352,7 @@ else
|
||||
|
||||
|
||||
print($mesg);
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td width="40%">'.$product->ref.'</td>';
|
||||
print '<td width="40%">';
|
||||
@ -376,7 +377,7 @@ else
|
||||
}
|
||||
|
||||
print '<td valign="top" rowspan="'.$nblignefour.'">';
|
||||
print 'Fournisseurs [<a href="fiche.php?id='.$product->id.'&action=ajout_fourn">Ajouter</a>]';
|
||||
print $langs->trans("Suppliers").' [<a href="fiche.php?id='.$product->id.'&action=ajout_fourn">'.$langs->trans("Add").'</a>]';
|
||||
|
||||
$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 '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -433,25 +434,16 @@ else
|
||||
if ($product->type == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Duration").'</td><TD>'.$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 '</td></tr>';
|
||||
}
|
||||
print "</table><br>\n";
|
||||
@ -466,12 +458,12 @@ else
|
||||
*/
|
||||
if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer)
|
||||
{
|
||||
print '<div class="titre">Nouveau prix</div>';
|
||||
print '<div class="titre">'.$langs->trans("NewPrice").'</div>';
|
||||
print '<form action="fiche.php?id='.$product->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update_price">';
|
||||
print '<input type="hidden" name="id" value="'.$product->id.'">';
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr><td width="20%">Prix de vente</td><td><input name="price" size="10" value="'.price($product->price).'"></td></tr>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="20%">'.$langs->trans('SellingPrice').'</td><td><input name="price" size="10" value="'.price($product->price).'"></td></tr>';
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
@ -488,8 +480,8 @@ else
|
||||
print '<form action="fiche.php?id='.$product->id.'" method="post">';
|
||||
print '<input type="hidden" name="action" value="add_fourn">';
|
||||
print '<input type="hidden" name="id" value="'.$product->id.'">';
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4"><tr>';
|
||||
print '<td>Fournisseurs</td><td><select name="id_fourn">';
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
print '<td>'.$langs->trans("Suppliers").'</td><td><select name="id_fourn">';
|
||||
|
||||
$sql = "SELECT s.idp, s.nom, s.ville FROM ".MAIN_DB_PREFIX."societe as s WHERE s.fournisseur=1";
|
||||
$sql .= " ORDER BY lower(s.nom)";
|
||||
@ -528,7 +520,7 @@ else
|
||||
print "<form action=\"fiche.php\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="'.$product->id.'">';
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>".'<td width="20%">'.$langs->trans("Ref").'</td><td colspan="2"><input name="ref" size="20" value="'.$product->ref.'"></td></tr>';
|
||||
print '<td>'.$langs->trans("Label").'</td><td colspan="2"><input name="libelle" size="40" value="'.$product->libelle.'"></td></tr>';
|
||||
|
||||
@ -541,13 +533,13 @@ else
|
||||
print '<select name="statut">';
|
||||
if ($product->envente)
|
||||
{
|
||||
print '<option value="1" selected>En vente</option>';
|
||||
print '<option value="0">Hors Vente</option>';
|
||||
print '<option value="1" selected>'.$langs->trans("OnSell").'</option>';
|
||||
print '<option value="0">'.$langs->trans("NotOnSell").'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="1">En vente</option>';
|
||||
print '<option value="0" selected>Hors Vente</option>';
|
||||
print '<option value="1">'.$langs->trans("OnSell").'</option>';
|
||||
print '<option value="0" selected>'.$langs->trans("NotOnSell").'</option>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
if ($product->type == 0 && defined("MAIN_MODULE_STOCK"))
|
||||
@ -568,43 +560,16 @@ else
|
||||
if ($product->type == 1)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="2"><input name="duration_value" size="6" maxlength="5" value="'.$product->duration_value.'">';
|
||||
switch ($product->duration_unit)
|
||||
{
|
||||
case "d":
|
||||
print '<input name="duration_unit" type="radio" value="d" checked>jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w">semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m">mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y">année';
|
||||
break;
|
||||
case "w":
|
||||
print '<input name="duration_unit" type="radio" value="d">jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w" checked>semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m">mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y">année';
|
||||
break;
|
||||
case "m":
|
||||
print '<input name="duration_unit" type="radio" value="d">jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w">semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m" checked>mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y">année';
|
||||
break;
|
||||
case "y":
|
||||
print '<input name="duration_unit" type="radio" value="d">jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w">semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m">mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y" checked>année';
|
||||
break;
|
||||
default:
|
||||
print '<input name="duration_unit" type="radio" value="d">jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w">semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m">mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y">année';
|
||||
break;
|
||||
}
|
||||
|
||||
print '<input name="duration_unit" type="radio" value="d"'.($product->duration_unit=='d'?' checked':'').'>jour ';
|
||||
print '<input name="duration_unit" type="radio" value="w"'.($product->duration_unit=='w'?' checked':'').'>semaine ';
|
||||
print '<input name="duration_unit" type="radio" value="m"'.($product->duration_unit=='m'?' checked':'').'>mois ';
|
||||
print '<input name="duration_unit" type="radio" value="y"'.($product->duration_unit=='y'?' checked':'').'>année';
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "<tr>".'<td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
print '<tr><td colspan="3" align="center"><input type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
@ -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 '<a class="tabAction" href="fiche.php?action=edit_price&id='.$product->id.'">Changer le prix</a>';
|
||||
print '<a class="tabAction" href="fiche.php?action=edit_price&id='.$product->id.'">'.$langs->trans("UpdatePrice").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,8 +63,8 @@ $result = $product->fetch($_GET["id"]);
|
||||
print '<div class="formsearch">';
|
||||
print '<form action="liste.php" method="post">';
|
||||
print '<input type="hidden" name="type" value="'.$product->type.'">';
|
||||
print $langs->trans("Ref").': <input class="flat" type="text" size="10" name="sref"> <input class="flat" type="submit" value="go"> ';
|
||||
print $langs->trans("Label").': <input class="flat" type="text" size="20" name="snom"> <input class="flat" type="submit" value="go">';
|
||||
print $langs->trans("Ref").': <input class="flat" type="text" size="10" name="sref"> <input class="flat" type="submit" value="'.$langs->trans("Go").'"> ';
|
||||
print $langs->trans("Label").': <input class="flat" type="text" size="20" name="snom"> <input class="flat" type="submit" value="'.$langs->trans("Go").'">';
|
||||
print '</form></div>';
|
||||
|
||||
|
||||
@ -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 '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><td colspan="3">Prix de vente pratiqués</td></tr>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("AppliedPricesFrom").'</td>';
|
||||
print '<td>'.$langs->trans("Price").'</td>';
|
||||
print '<td>'.$langs->trans("ChangedBy").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@ -119,8 +124,9 @@ if ($result)
|
||||
$objp = $db->fetch_object( $i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td>".strftime("%d %B %Y %H:%M:%S",$objp->dp)."</td>";
|
||||
print "<td>".dolibarr_print_date($objp->dp,"%d %B %Y %H:%M:%S")."</td>";
|
||||
print "<td>".price($objp->price)."</td>";
|
||||
print "<td>".$objp->login."</td>";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
@ -132,11 +138,32 @@ if ($result)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $db->error() . "<br>" .$sql;
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($_GET["action"] == '')
|
||||
{
|
||||
if ($user->rights->produit->modifier || $user->rights->produit->creer)
|
||||
{
|
||||
print '<a class="tabAction" href="fiche.php?action=edit_price&id='.$product->id.'">'.$langs->trans("UpdatePrice").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user