diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 85f2089555e..4206a43ca03 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1305,8 +1305,12 @@ if ($action == 'create')
$detail = '';
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
- $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
- $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
+ }
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
$detail .= ' ';
print $detail;
@@ -2308,8 +2312,12 @@ if ($action == 'create')
foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch
{
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
- $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
- $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ $detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
+ }
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
$detail .= ' ';
}
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index c64d158ac2c..f3a1b1d86dd 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -733,8 +733,12 @@ if ($id > 0 || !empty($ref)) {
print '
'.$langs->trans("Description").' ';
if (!empty($conf->productbatch->enabled)) {
print ''.$langs->trans("batch_number").' ';
- print ''.$langs->trans("EatByDate").' ';
- print ''.$langs->trans("SellByDate").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.$langs->trans("EatByDate").' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.$langs->trans("SellByDate").' ';
+ }
} else {
print ' ';
print ' ';
@@ -819,8 +823,12 @@ if ($id > 0 || !empty($ref)) {
print $linktoprod;
print "";
print ' ';
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ' ';
+ }
} else {
print '';
print $linktoprod;
@@ -828,8 +836,12 @@ if ($id > 0 || !empty($ref)) {
print ' ';
print $langs->trans("ProductDoesNotUseBatchSerial");
print ' ';
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ' ';
+ }
}
} else {
print '';
@@ -896,14 +908,18 @@ if ($id > 0 || !empty($ref)) {
print ' ';
print ' ';
print ' ';
- print '';
- $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
- print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
- print ' ';
- print '';
- $dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
- print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '';
+ $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc' . $suffix . 'month'), GETPOST('dlc' . $suffix . 'day'), GETPOST('dlc' . $suffix . 'year'));
+ print $form->selectDate($dlcdatesuffix, 'dlc' . $suffix, '', '', 1, '');
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '';
+ $dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
+ print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, '');
+ print ' ';
+ }
print '  '; // Supplier ref + Qty ordered + qty already dispatched
} else {
$type = 'dispatch';
@@ -1118,8 +1134,12 @@ if ($id > 0 || !empty($ref)) {
print ''.$langs->trans("DateDeliveryPlanned").' ';
if (!empty($conf->productbatch->enabled)) {
print ''.$langs->trans("batch_number").' ';
- print ''.$langs->trans("EatByDate").' ';
- print ''.$langs->trans("SellByDate").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '' . $langs->trans("EatByDate") . ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print '' . $langs->trans("SellByDate") . ' ';
+ }
}
print ''.$langs->trans("QtyDispatched").' ';
print ''.$langs->trans("Warehouse").' ';
@@ -1174,8 +1194,12 @@ if ($id > 0 || !empty($ref)) {
$lot=new Productlot($db);
$lot->fetch(0, $objp->pid, $objp->batch);
print ''.$lot->getNomUrl(1).' ';
- print ''.dol_print_date($lot->eatby, 'day').' ';
- print ''.dol_print_date($lot->sellby, 'day').' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '' . dol_print_date($lot->eatby, 'day') . ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print '' . dol_print_date($lot->sellby, 'day') . ' ';
+ }
} else {
print ' ';
print ' ';
diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php
index f43ccd3dcd4..e281d45ee74 100644
--- a/htdocs/mrp/mo_movements.php
+++ b/htdocs/mrp/mo_movements.php
@@ -143,6 +143,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
+if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ unset($arrayfields['pl.eatby']);
+}
+if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ unset($arrayfields['pl.sellby']);
+}
$objectlist->fields = dol_sort_array($objectlist->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index de49a11fbc7..050d0d12f4b 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -284,8 +284,12 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ' ';
+ }
print ' ';
print ' ';
print '';
@@ -302,8 +306,12 @@ if ($resql)
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", $param, "", '', $sortfield, $sortorder);
//print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right );
print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center ');
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center ');
+ }
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right ');
// TODO Add info of running suppliers/customers orders
//print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'',$sortfield,$sortorder, 'right ');
@@ -400,8 +408,12 @@ if ($resql)
}
print ' ';
- print ''.dol_print_date($db->jdate($objp->eatby), 'day').' ';
- print ''.dol_print_date($db->jdate($objp->sellby), 'day').' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.dol_print_date($db->jdate($objp->eatby), 'day').' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.dol_print_date($db->jdate($objp->sellby), 'day').' ';
+ }
print '';
//if ($objp->seuil_stock_alerte && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' ';
print $objp->stock_physique;
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index f144fe38a75..1c93d1ee943 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -170,8 +170,12 @@ if ($resql)
if (!empty($conf->productbatch->enabled))
{
print ' '.$langs->trans("Batch").' ';
- print ''.$langs->trans("SellByDate").' ';
- print ''.$langs->trans("EatByDate").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.$langs->trans("SellByDate").' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.$langs->trans("EatByDate").' ';
+ }
}
print ''.$langs->trans("Warehouse").' ';
print ''.$langs->trans("FullList").' ';
@@ -202,8 +206,12 @@ if ($resql)
if (!empty($conf->productbatch->enabled))
{
print ''.$objp->batch.' ';
- print ''.dol_print_date($db->jdate($objp->sellby), 'day').' ';
- print ''.dol_print_date($db->jdate($objp->eatby), 'day').' ';
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.dol_print_date($db->jdate($objp->sellby), 'day').' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.dol_print_date($db->jdate($objp->eatby), 'day').' ';
+ }
}
print '';
print $warehouse->getNomUrl(1);
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index c844bae01e2..ee4c77eb2e4 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -121,6 +121,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
+if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ unset($arrayfields['pl.eatby']);
+}
+if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ unset($arrayfields['pl.sellby']);
+}
// Security check
if (!$user->rights->stock->mouvement->lire) {
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index e7fffeaffb7..f59698ef6d6 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 ' ';
@@ -888,13 +895,17 @@ if (!$variants) {
print ' ';
print ' ';
print ' ';
- print '';
- print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
- print ' ';
- print '';
- print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
- print ' ';
- print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '';
+ print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print '';
+ print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
+ print ' ';
+ }
+ print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' ';
print ' ';
print ' ';
print '
';
@@ -911,9 +922,16 @@ if (!$variants) {
print '';
print $product_lot_static->getNomUrl(1);
print ' ';
- print ''.dol_print_date($pdluo->eatby, 'day').' ';
- print ''.dol_print_date($pdluo->sellby, 'day').' ';
- print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' ';
+ $colspan = 3;
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ $colspan--;
+ print ''.dol_print_date($pdluo->eatby, 'day').' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ $colspan--;
+ print ''.dol_print_date($pdluo->sellby, 'day').' ';
+ }
+ print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' ';
print ' ';
print ' ';
}
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 9b6de313b65..0f706c3ccae 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -327,21 +327,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '';
// Eat by
- print '';
- print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
- print ' ';
- print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '';
+ print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
+ print ' ';
+ print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
+ print ' ';
+ print ' ';
+ }
// Sell by
- print '';
- print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
- print ' ';
- print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
- print ' ';
- print ' ';
-
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print '';
+ print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
+ print ' ';
+ print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker');
+ print ' ';
+ print ' ';
+ }
// Other attributes
$cols = 2;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 0fb3c4a0388..ec5e3ebde69 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -99,6 +99,12 @@ $arrayfields = array(
't.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
//'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
);
+if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ unset($arrayfields['t.sellby']);
+}
+if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ unset($arrayfields['t.eatby']);
+}
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
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 ' ';
}
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 7bc99977943..27722c29ed4 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -966,8 +966,12 @@ if ($action == 'create')
if (!empty($conf->productbatch->enabled))
{
print ''.$langs->trans("batch_number").' ';
- print ''.$langs->trans("EatByDate").' ';
- print ''.$langs->trans("SellByDate").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print ''.$langs->trans("EatByDate").' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print ''.$langs->trans("SellByDate").' ';
+ }
}
print "\n";
}
@@ -1114,12 +1118,16 @@ if ($action == 'create')
if (!empty($product->status_batch))
{
print ' ';
- print '';
- print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
- print ' ';
- print '';
- print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print '';
+ print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
+ print ' ';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print '';
+ print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
+ print ' ';
+ }
} else {
print ' ';
}
@@ -1807,10 +1815,14 @@ if ($action == 'create')
if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch))
{
print ' ';
- print $langs->trans('EatByDate').' : ';
- print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'';
- print $langs->trans('SellByDate').' : ';
- print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, "");
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
+ print $langs->trans('EatByDate').' : ';
+ print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'';
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
+ print $langs->trans('SellByDate').' : ';
+ print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, "");
+ }
print ' ';
}
print '';
@@ -1856,11 +1868,14 @@ if ($action == 'create')
$detail = '';
if ($lines[$i]->product->status_batch)
{
- $detail .= $langs->trans("Batch").': '.$lines[$i]->batch;
+ $detail .= $langs->trans("Batch").': '.$lines[$i]->batch;
+ if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby, "day");
+ }
+ if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby, "day");
-
- $detail .= ' ';
+ }
+ $detail .= ' ';
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
} else {