diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index c9e7a2828ef..3ab61f07705 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -193,8 +193,9 @@ if ($resql)
print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("TheoreticalStock"),"reassort.php", "stock_theorique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder);
if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder);
+ print '
| ';
print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder);
print "\n";
@@ -212,9 +213,9 @@ if ($resql)
print ' ';
print '';
}
- print '';
- print ' ';
- print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
print '';
print '';
print '';
@@ -264,8 +265,9 @@ if ($resql)
print ' | ';
}
//print ''.$objp->stock_theorique.' | ';
- print ''.$objp->stock_physique.' | ';
print ''.$objp->seuil_stock_alerte.' | ';
+ print ''.$objp->stock_physique.' | ';
+ print ''.$langs->trans("Movements").' | ';
print ''.$product_static->LibStatut($objp->statut,5).' | ';
print "\n";
$i++;
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 8d3e08afa1b..4ebb0131373 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2008 Laurent Destailleur
+ * Copyright (C) 2004-2009 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("products");
@@ -34,6 +35,9 @@ if (!$user->rights->produit->lire) accessforbidden();
$page = $_GET["page"];
$sortfield = $_GET["sortfield"];
$sortorder = $_GET["sortorder"];
+$idproduct = isset($_GET["idproduct"])?$_GET["idproduct"]:$_PRODUCT["idproduct"];
+$year = isset($_GET["year"])?$_GET["year"]:$_POST["year"];
+$month = isset($_GET["month"])?$_GET["month"]:$_POST["month"];
if ($page < 0) $page = 0;
$offset = $conf->liste_limit * $page;
@@ -67,6 +71,22 @@ if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql.= " AND IFNULL(c.visible,1)=1";
}
+if ($month > 0)
+{
+ if ($year > 0)
+ $sql.= " AND date_format(m.datem, '%Y-%m') = '$year-$month'";
+ else
+ $sql.= " AND date_format(m.datem, '%m') = '$month'";
+}
+if ($year > 0) $sql .= " AND date_format(m.datem, '%Y') = $year";
+if (! empty($_GET['search_product']))
+{
+ $sql.= " AND p.label LIKE '%".addslashes($_GET['search_product'])."%'";
+}
+if (! empty($_GET['idproduct']))
+{
+ $sql.= " AND p.rowid = '".$_GET['idproduct']."'";
+}
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset);
@@ -76,6 +96,12 @@ if ($resql)
{
$num = $db->num_rows($resql);
+ if ($idproduct)
+ {
+ $product = new Product($db);
+ $product->fetch($idproduct);
+ }
+
if ($_GET["id"])
{
$entrepot = new Entrepot($db);
@@ -159,6 +185,28 @@ if ($resql)
print_liste_field_titre($langs->trans("Units"),"mouvement.php", "m.value","",$param,'align="right"',$sortfield,$sortorder);
print "\n";
+ // Lignes des champs de filtre
+ print '';
+
$var=True;
while ($i < min($num,$conf->liste_limit))
{