diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index af7a95fb95a..f4669c44cea 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -805,11 +805,18 @@ if (!$variants) {
print '
'.$langs->trans("EstimatedStockValueSellShort").' | ';
print '';
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
+ $colspan = 3;
print ' | ';
print ''.$langs->trans("batch_number").' | ';
- print ''.$langs->trans("EatByDate").' | ';
- print ''.$langs->trans("SellByDate").' | ';
- print ' | ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ $colspan--;
+ print ''.$langs->trans("EatByDate").' | ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ $colspan--;
+ print ''.$langs->trans("SellByDate").' | ';
+ }
+ print ' | ';
print ' | ';
print ' | ';
print ' | ';
@@ -887,14 +894,18 @@ if (!$variants) {
print '
';
}
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 98826ca6799..88cced3b99d 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -103,14 +103,18 @@ if (!empty($conf->productbatch->enabled) &&
print '';
print '';
print '';
- print '| '.$langs->trans("EatByDate").' | ';
- $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
- print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
- print ' | ';
- print ''.$langs->trans("SellByDate").' | ';
- $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
- print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
- print ' | ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.$langs->trans("EatByDate").' | ';
+ $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
+ print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
+ print ' | ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.$langs->trans("SellByDate").' | ';
+ $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
+ print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
+ print ' | ';
+ }
print '
';
}
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index f725a5ebbfe..0164e99bd37 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -107,12 +107,16 @@ if (!empty($conf->productbatch->enabled) &&
print '';
print '';
- print '| '.$langs->trans("EatByDate").' | ';
- print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print ' | ';
- print ''.$langs->trans("SellByDate").' | ';
- print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print ' | ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.$langs->trans("EatByDate").' | ';
+ print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print ' | ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.$langs->trans("SellByDate").' | ';
+ print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print ' | ';
+ }
print '
';
}