diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 39a9e5ae601..c2d64d977c3 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -758,6 +758,21 @@ if ($conf->use_javascript_ajax) {
}
print "\n";
print "\n";
+
+if (!empty($conf->productbatch->enabled)) {
+ print '
';
+ print '| ' . $langs->trans("ShowAllBatchByDefault") . ' | ';
+ print '';
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('STOCK_SHOW_ALL_BATCH_BY_DEFAULT');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("STOCK_SHOW_ALL_BATCH_BY_DEFAULT", $arrval, $conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT);
+ }
+ print " | \n";
+ print "
\n";
+}
+
print '';
print '';
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 1b54e53d6de..376b86fcef7 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -240,4 +240,5 @@ InventoryRealQtyHelp=Set value to 0 to reset qty
Keep field empty, or remove
UpdateByScaning=Update by scaning
UpdateByScaningProductBarcode=Update by scan (product barcode)
UpdateByScaningLot=Update by scan (lot|serial barcode)
-DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.
\ No newline at end of file
+DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.
+ShowAllBatchByDefault=By default, show batch details on product "stock" tab
diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang
index 444c546b853..cf178141f74 100644
--- a/htdocs/langs/fr_FR/stocks.lang
+++ b/htdocs/langs/fr_FR/stocks.lang
@@ -242,3 +242,4 @@ UpdateByScaning=Mise à jour par scan
UpdateByScaningProductBarcode=Mettre à jour par scan (code-barres produit)
UpdateByScaningLot=Mise à jour par scan (code barres lot/série)
DisableStockChangeOfSubProduct=Désactiver les mouvements de stock des composants pour tout mouvement de stock de ce kit
+ShowAllBatchByDefault=Dérouler par défaut le détail des lots dans l'onglet "stock"
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index d1c1ea99ff7..1b72404011b 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -9,6 +9,7 @@
* Copyright (C) 2014-2015 Cédric Gross
* Copyright (C) 2015 Marcos García
* Copyright (C) 2018-2019 Frédéric France
+ * Copyright (C) 2021 Gauthier VERDOL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -522,6 +523,48 @@ if ($id > 0 || $ref)
llxHeader('', $title, $helpurl);
+ ?>
+
+
+
+ 0)
{
$head = product_prepare_head($object);
@@ -828,7 +871,10 @@ if (!$variants) {
print '';
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
$colspan = 3;
- print ' | ';
+ print '
| ';
+ print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'';
+ print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'';
+ print ' | ';
print ''.$langs->trans("batch_number").' | ';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
@@ -880,7 +926,11 @@ if (!$variants) {
$stock_real = price2num($obj->reel, 'MS');
print '
';
- print '| '.$entrepotstatic->getNomUrl(1).' | ';
+ print '';
+ if(!empty($conf->productbatch->enabled)) {
+ print '' . (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)') . ' ';
+ }
+ print $entrepotstatic->getNomUrl(1).' | ';
print ''.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').' | ';
// PMP
print ''.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').' | ';
@@ -934,7 +984,7 @@ if (!$variants) {
print '';
print '
';
} else {
- print "\n".'| ';
+ print "\n".' |
| ';
print img_picto($langs->trans("Tranfer"), 'uparrow', 'class="hideonsmartphone"').' ';
print 'id.'&id_entrepot='.$entrepotstatic->id.'&action=transfert&pdluoid='.$pdluo->id.'">'.$langs->trans("TransferStock").'';
// Disabled, because edition of stock content must use the "Correct stock menu".
|