diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php
index 5517d3d7cdc..35bba2519c0 100644
--- a/htdocs/product/stock/fiche.php
+++ b/htdocs/product/stock/fiche.php
@@ -164,184 +164,203 @@ if ($_GET["action"] == 'create')
}
else
{
- if ($_GET["id"])
+ if ($_GET["id"])
{
-
- if ($mesg) print $mesg;
-
- $entrepot = new Entrepot($db);
- $result = $entrepot->fetch($_GET["id"]);
- if (! $result)
+ if ($mesg) print $mesg;
+
+ $entrepot = new Entrepot($db);
+ $result = $entrepot->fetch($_GET["id"]);
+ if (! $result)
{
- dolibarr_print_error($db);
+ dolibarr_print_error($db);
}
-
- /*
- * Affichage fiche
- */
- if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
+
+ /*
+ * Affichage fiche
+ */
+ if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{
-
- /*
- * Affichage onglets
- */
- $h = 0;
-
- $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
- $head[$h][1] = $langs->trans("WarehouseCard");
- $hselected=$h;
- $h++;
-
- $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
- $head[$h][1] = $langs->trans("Info");
- $h++;
-
- dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
-
- print '
';
- print ''.$langs->trans("Ref").' '.$entrepot->libelle.' ';
- print ''.$langs->trans("Description").' '.nl2br($entrepot->description).' ';
-
- print ''.$langs->trans("LocationSummary").' '.$entrepot->lieu.' ';
-
- print ''.$langs->trans('Address').' ';
- print $entrepot->address;
- print ' ';
-
- print ''.$langs->trans('Zip').' '.$entrepot->cp.' ';
- print ''.$langs->trans('Town').' '.$entrepot->ville.' ';
-
- print ''.$langs->trans('Country').' ';
- $entrepot->pays;
- print ' ';
-
- print ''.$langs->trans("Status").' '.$entrepot->statuts[$entrepot->statut].' ';
-
- print ''.$langs->trans("NumberOfProducts").' ';
- print $entrepot->nb_products();
- print " ";
-
- $sql = "SELECT max( ".$db->pdate("m.datem").") as datem";
- $sql .= " FROM llx_stock_mouvement as m";
- $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."';";
- $resql = $db->query($sql);
- if ($resql)
- {
- $row = $db->fetch_row($resql);
- }
+ /*
+ * Affichage onglets
+ */
+ $h = 0;
- print ''.$langs->trans("DernierMouvement").' ';
- print strftime("%e %B %Y",$row[0]);
- print " ";
- print "
";
-
- //affichage de la liste des produits de l\'entrepot
- print '';
- print "";
+ $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id;
+ $head[$h][1] = $langs->trans("WarehouseCard");
+ $hselected=$h;
+ $h++;
- print_liste_field_titre($langs->trans("Product"),"", "p.ref","","","",$sortfield);
+ $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
+ $head[$h][1] = $langs->trans("Info");
+ $h++;
- print "".$langs->trans("Units")." ";
- print " \n";
- $sql = "SELECT p.rowid as rowid, p.label as produit, ps.reel as value ";
- $sql .= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p ";
- $sql .= " WHERE ps.fk_product = p.rowid ";
- $sql .= " AND ps.reel >0 AND ps.fk_entrepot = $id";
+ dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle);
- //$sql .= $db->plimit($limit + 1 ,$offset);
+ print '';
+ print ''.$langs->trans("Ref").' '.$entrepot->libelle.' ';
+ print ''.$langs->trans("Description").' '.nl2br($entrepot->description).' ';
+
+ print ''.$langs->trans("LocationSummary").' '.$entrepot->lieu.' ';
+
+ print ''.$langs->trans('Address').' ';
+ print $entrepot->address;
+ print ' ';
+
+ print ''.$langs->trans('Zip').' '.$entrepot->cp.' ';
+ print ''.$langs->trans('Town').' '.$entrepot->ville.' ';
+
+ print ''.$langs->trans('Country').' ';
+ $entrepot->pays;
+ print ' ';
+
+ print ''.$langs->trans("Status").' '.$entrepot->statuts[$entrepot->statut].' ';
+
+ print ''.$langs->trans("NumberOfProducts").' ';
+ print $entrepot->nb_products();
+ print " ";
+
+ // Dernier mouvement
+ $sql = "SELECT max( ".$db->pdate("m.datem").") as datem";
+ $sql .= " FROM llx_stock_mouvement as m";
+ $sql .= " WHERE m.fk_entrepot = '".$entrepot->id."';";
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $row = $db->fetch_row($resql);
+ }
+ else
+ {
+ dolibarr_print_error($db);
+ }
+
+ print ''.$langs->trans("LastMovement").' ';
+ print dolibarr_print_date($row[0]);
+ print " ";
+ print "
";
+
+ print '';
+
+
+ /* ************************************************************************** */
+ /* */
+ /* Barre d'action */
+ /* */
+ /* ************************************************************************** */
+
+ print "";
+
+
+ /* ************************************************************************** */
+ /* */
+ /* Affichage de la liste des produits de l'entrepot */
+ /* */
+ /* ************************************************************************** */
+ print ' ';
+
+ print '';
+ print "";
+
+ print_liste_field_titre($langs->trans("Product"),"", "p.ref","","","",$sortfield);
+
+ print "".$langs->trans("Units")." ";
+ print " \n";
+ $sql = "SELECT p.rowid as rowid, p.label as produit, ps.reel as value ";
+ $sql .= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p ";
+ $sql .= " WHERE ps.fk_product = p.rowid ";
+ $sql .= " AND ps.reel >0 AND ps.fk_entrepot = ".$entrepot->id;
+
+ //$sql .= $db->plimit($limit + 1 ,$offset);
+
+ $resql = $db->query($sql) ;
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+ $i = 0;
+ $var=True;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object($resql);
+ $var=!$var;
+ print "";
+ //print ''.dolibarr_print_date($objp->datem).' ';
+ print "rowid\">";
+ print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit;
+ print " \n";
+ print ''.$objp->value.' ';
+ //print "entrepot_id\">";
+ //print img_object($langs->trans("ShowWarehous"),"stock").' '.$objp->stock;
+ //print " \n";
+ print " \n";
+ $i++;
+ }
+ $db->free($resql);
+ }
+ else
+ {
+ dolibarr_print_error($db);
+ }
+ print "
\n";
+ print "\n";
- $resql = $db->query($sql) ;
- if ($resql)
- {$num = $db->num_rows($resql);
- $i = 0;
- $var=True;
- while ($i < $num)
- {
- $objp = $db->fetch_object($resql);
- $var=!$var;
- print "";
- //print ''.dolibarr_print_date($objp->datem).' ';
- print "rowid\">";
- print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit;
- print " \n";
- print ''.$objp->value.' ';
- //print "entrepot_id\">";
- //print img_object($langs->trans("ShowWarehous"),"stock").' '.$objp->stock;
- //print " \n";
- print " \n";
- $i++;
- }
- $db->free($resql);
- }
- print "
\n";
- print "\n";
-
}
-
-
- /*
- * Edition fiche
- */
- if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && 1)
+
+
+ /*
+ * Edition fiche
+ */
+ if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && 1)
{
- print_fiche_titre('Edition de la fiche entrepot', $mesg);
-
- print '';
-
+ print_fiche_titre('Edition de la fiche entrepot', $mesg);
+
+ print '';
+ print ' ';
+ print ' ';
+
+ print '';
+ print ' ';
+
}
}
}
-/* ************************************************************************** */
-/* */
-/* Barre d'action */
-/* */
-/* ************************************************************************** */
-
-print "";
$db->close();
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index f778f88bb4d..dc66d8105b1 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -158,7 +158,11 @@ if ($_GET["id"])
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id;
- $head[$h][1] = $langs->trans('Bills');
+ $head[$h][1] = $langs->trans('Referers');
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
+ $head[$h][1] = $langs->trans('Documents');
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
@@ -193,8 +197,7 @@ if ($_GET["id"])
// Stock
if ($product->type == 0 && $conf->stock->enabled)
{
- print 'id.'">'.$langs->trans("Stock").' ';
+ print ''.$langs->trans("Stock").' ';
if ($product->no_stock)
{
print "Pas de définition de stock pour ce produit";
@@ -277,8 +280,8 @@ href="'.DOL_URL_ROOT.'/product/stock/product.php?id='.$product->id.'">'.$langs->
print ''.$langs->trans("Delete").' ';
print ' ';
print 'Nb de pièce ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
print '';
print '';
@@ -333,8 +336,8 @@ href="'.DOL_URL_ROOT.'/product/stock/product.php?id='.$product->id.'">'.$langs->
}
print '';
print 'Nb de pièce ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
print '';
print '';
@@ -367,8 +370,8 @@ href="'.DOL_URL_ROOT.'/product/stock/product.php?id='.$product->id.'">'.$langs->
}
}
print 'Nb de pièce ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
print '';
print '';
}