From 7d25d3c710115a0c43091ad6a33c816fc6707789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 19 Aug 2022 19:59:53 +0200 Subject: [PATCH] apply fix --- htdocs/product/stock/tpl/stockcorrection.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index eb927756263..40181167baa 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -164,14 +164,14 @@ if (ismodEnabled('productbatch') && print ''.$langs->trans("SellByDate").''; $sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear')); // If form was opened for a specific pdluoid, field is disabled - print $form->selectDate((!empty($sellbyselected) ? $sellbyselected : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); + print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); print ''; } if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ''.$langs->trans("EatByDate").''; $eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear')); // If form was opened for a specific pdluoid, field is disabled - print $form->selectDate((!empty($eatbyselected) ? $eatbyselected : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); + print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); print ''; } print '';