diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index baa0b6872f4..a608875a752 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -13,7 +13,7 @@ MenuNewPrivateIndividual=New private individual
NewCompany=New company (prospect, customer, supplier)
NewThirdParty=New third party (prospect, customer, supplier)
CreateDolibarrThirdPartySupplier=Create a third party (supplier)
-CreateThirdPartyOnly=Create thirdpary
+CreateThirdPartyOnly=Create third party
CreateThirdPartyAndContact=Create a third party + a child contact
ProspectionArea=Prospection area
IdThirdParty=Id third party
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 88bc6d834aa..7d23700f983 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -62,16 +62,19 @@ DeStockOnShipment=Decrease real stocks on shipping validation
DeStockOnShipmentOnClosing=Decrease real stocks on shipping classification closed
ReStockOnBill=Increase real stocks on suppliers invoices/credit notes validation
ReStockOnValidateOrder=Increase real stocks on suppliers orders approbation
-ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving
+ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receipt of goods
OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses.
-StockDiffPhysicTeoric=Explanation for difference between physical and theoretical stock
+StockDiffPhysicTeoric=Explanation for difference between physical and virtual stock
NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required.
DispatchVerb=Dispatch
StockLimitShort=Limit for alert
StockLimit=Stock limit for alert
PhysicalStock=Physical stock
RealStock=Real Stock
+RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
+RealStockWillAutomaticallyWhen=The real stock will automatically change according to this rules (see stock module setup to change this):
VirtualStock=Virtual stock
+VirtualStockDesc=Virtual stock is the stock you will get once all opened pending actions that affect stocks will be closed (supplier order received, customer order shipped, ...)
IdWarehouse=Id warehouse
DescWareHouse=Description warehouse
LieuWareHouse=Localisation warehouse
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index 471aa7e3e6d..01285f09417 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -126,10 +126,7 @@ $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowi
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
-if ($sall)
-{
- $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
-}
+if ($sall) $sql.=natural_search(array('p.ref','p.label','p.description','p.note'), $sall);
// if the type is not 1, we show all products (type = 0,2,3)
if (dol_strlen($type))
{
@@ -163,6 +160,12 @@ $sql.= " pb.batch, pb.eatby, pb.sellby,";
$sql.= " pl.eatby, pl.sellby";
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder);
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+{
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+}
$sql.= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
@@ -193,11 +196,11 @@ if ($resql)
if ($sref || $snom || $sall || GETPOST('search'))
{
- print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, 0, 'title_products');
+ print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products');
}
else
{
- print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, 0, 'title_products');
+ print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products');
}
if (! empty($catid))
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index 0d92afe96e0..f28f3fd00d3 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -438,6 +438,35 @@ class Productlot extends CommonObject
}
}
+
+ /**
+ * Return label of status of object
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label of status
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut(0,$mode);
+ }
+
+ /**
+ * Return label of a given status
+ *
+ * @param int $statut Status
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label of status
+ */
+ function LibStatut($statut,$mode=0)
+ {
+ global $langs;
+
+ //$langs->load('stocks');
+
+ return '';
+ }
+
+
/**
* Return a link to the a lot card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index d23dca08282..d2ba81db86c 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -95,7 +95,7 @@ $arrayfields=array(
'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))),
'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))),
'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))),
- 'm.warehouse'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it
+ 'e.label'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it
'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1),
@@ -665,6 +665,7 @@ if ($resql)
if ($search_inventorycode) $param.='&search_inventorycode='.urlencode($search_inventorycode);
if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref);
if ($search_product) $param.='&search_product='.urlencode($search_product);
+ if ($search_batch) $param.='&search_batch='.urlencode($search_batch);
if ($search_warehouse > 0) $param.='&search_warehouse='.urlencode($search_warehouse);
if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
@@ -735,7 +736,7 @@ if ($resql)
if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['m.warehouse']['checked'])) print_liste_field_titre($arrayfields['m.warehouse']['label'],$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
+ if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder);
@@ -799,7 +800,7 @@ if ($resql)
// Batch
if (! empty($arrayfields['m.batch']['checked']))
{
- print '
';
+ print '
';
}
if (! empty($arrayfields['pl.eatby']['checked']))
{
@@ -812,7 +813,7 @@ if ($resql)
print '';
}
// Warehouse
- if (! empty($arrayfields['m.warehouse']['checked']))
+ if (! empty($arrayfields['e.label']['checked']))
{
print '