diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index de09bb80ea4..9ce89761d40 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -738,12 +738,12 @@ if ($id > 0 || !empty($ref)) { print '
| '; print ' | '; - 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 ' | '; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0); + print ' | '; + } print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' | '; print ''; print ' | '.dol_print_date($pdluo->eatby, 'day').' | '; - } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $colspan--; print ''.dol_print_date($pdluo->sellby, 'day').' | '; } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + $colspan--; + print ''.dol_print_date($pdluo->eatby, '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 26c388c6b34..d8a727af0ec 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -335,6 +335,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label; print ''; + // Sell by + 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 '||||||||||
| '; @@ -345,15 +355,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 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 '||||||||||
| '.$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 ' | '; } + 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 ' | '; + } 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 ' | '; } + 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 ' | '; + } print ''.$langs->trans("batch_number").' | '; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - 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 "\n"; } @@ -1077,8 +1077,7 @@ if ($action == 'create') print ''; - if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { + if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $quantityToBeDelivered = 0; } else { $quantityToBeDelivered = $dispatchLines[$indiceAsked]['qty']; @@ -1130,12 +1129,12 @@ if ($action == 'create') if (!empty($product->status_batch)) { print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ' | '; print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, ""); print ' | '; } - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ''; print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, ""); print ' | '; @@ -1827,11 +1826,11 @@ if ($action == 'create') if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) { print ''; - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print $langs->trans('EatByDate').' : '; print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").''; } - if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print $langs->trans('SellByDate').' : '; print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, ""); } |