NEW show sell-by and eat-by dates only if not empty

This commit is contained in:
lvessiller 2022-08-12 15:20:25 +02:00
parent a570244641
commit 8ac5bd4228

View File

@ -1315,10 +1315,10 @@ if ($action == 'create') {
$detail = '';
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
}
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
@ -1526,10 +1526,10 @@ if ($action == 'create') {
} else {
print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY) && !empty($dbatch->sellby)) {
print ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_EATBY) && !empty($dbatch->eatby)) {
print ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
}
print ' ('.$dbatch->qty.')';