display lot with getNomUrl

This commit is contained in:
Frédéric FRANCE 2022-12-12 11:16:58 +01:00 committed by GitHub
parent 7a6e63befd
commit d3f9f5c0cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1952,22 +1952,16 @@ if ($action == 'create') {
if (isset($lines[$i]->batch)) {
print '<!-- Detail of lot -->';
print '<td class="linecolbatch">';
$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 .= '<br>';
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
} else {
print $langs->trans("NA");
}
print '</td>';
print $detail . '</td>';
} else {
print '<td></td>';
}