diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c64d158ac2c..4b077d861f3 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/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 9b6de313b65..f091de9d78e 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';