diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index c4931944c57..e9375f91e30 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4104,15 +4104,14 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
//var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1);
// If field is used as sort criteria we use a specific css class liste_titre_sel
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
+ $liste_titre = 'liste_titre';
if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
- $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib;
- $out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:&;]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
- $out .= '>';
- } else {
- $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib;
- $out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:&;]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
- $out .= '>';
+ $liste_titre = 'liste_titre_sel';
}
+ $out .= '<'.$tag.' class="'.$prefix.$liste_titre.'" '.$moreattrib;
+ //$out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:&;]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
+ $out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
+ $out .= '>';
if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field
{
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index ca6e39c2b07..534b9300158 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -211,6 +211,7 @@ class MouvementStock extends CommonObject
{
if (empty($batch))
{
+ $langs->load("errors");
$this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
dol_syslog("Try to make a movement of a product with status_batch on without any batch data");
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 858058ef684..54d57bf5d75 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -195,7 +195,7 @@ if ($action == 'setdesiredstock' && !empty($user->rights->produit->creer))
// Correct stock
if ($action == "correct_stock" && !$cancel)
{
- if (!(GETPOST("id_entrepot") > 0))
+ if (!(GETPOST("id_entrepot", 'int') > 0))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$error++;
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 08fb9d6a1f0..98b9f54b2ff 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -312,6 +312,9 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre
$sql .= ' '.$sqldesiredtock.' as desiredstockcombined, '.$sqlalertstock.' as seuil_stock_alertecombined,';
$sql .= ' s.fk_product,';
$sql .= ' SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").') as stock_physique';
+if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
+ $sql .= ', SUM('.$db->ifsql("s.reel IS NULL OR s.fk_entrepot <> ".$fk_entrepot, "0", "s.reel").') as stock_real_warehouse';
+}
// Add fields from hooks
$parameters = array();
@@ -530,18 +533,20 @@ if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_
if ($usevirtualstock == 1)
{
print $langs->trans("CurentSelectionMode").': ';
- print $langs->trans("CurentlyUsingVirtualStock").' - ';
- print ''.$langs->trans("UsePhysicalStock").'
';
+ print $langs->trans("CurentlyUsingVirtualStock");
+ print ' ('.$langs->trans("UsePhysicalStock").')';
+ print '
';
}
if ($usevirtualstock == 0)
{
print $langs->trans("CurentSelectionMode").': ';
- print $langs->trans("CurentlyUsingPhysicalStock").' - ';
- print ''.$langs->trans("UseVirtualStock").'
';
+ print $langs->trans("CurentlyUsingPhysicalStock");
+ print ' ('.$langs->trans("UseVirtualStock").')';
+ print '
';
}
print '
'."\n";
-print '