From d3f9f5c0cdc6444f4970d1700fc83f5e3ee6a0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 12 Dec 2022 11:16:58 +0100 Subject: [PATCH] display lot with getNomUrl --- htdocs/reception/card.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3e99bc1194c..8f28dc72bb8 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1952,22 +1952,16 @@ if ($action == 'create') { if (isset($lines[$i]->batch)) { print ''; print ''; - $detail = ''; - if ($lines[$i]->product->status_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"); + $detail = $langs->trans("NA"); + if ($lines[$i]->product->status_batch && $lines[$i]->fk_product > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/stock/productlot.class.php'; + $productlot = new Productlot($db); + $reslot = $productlot->fetch(0, $lines[$i]->fk_product, $lines[$i]->batch); + if ($reslot > 0) { + $detail = $productlot->getNomUrl(1); } - if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - $detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($lines[$i]->eatby, "day"); - } - $detail .= '
'; - - print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); - } else { - print $langs->trans("NA"); } - print ''; + print $detail . ''; } else { print ''; }