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)) { if (isset($lines[$i]->batch)) {
print '<!-- Detail of lot -->'; print '<!-- Detail of lot -->';
print '<td class="linecolbatch">'; print '<td class="linecolbatch">';
$detail = ''; $detail = $langs->trans("NA");
if ($lines[$i]->product->status_batch) { if ($lines[$i]->product->status_batch && $lines[$i]->fk_product > 0) {
$detail .= $langs->trans("Batch").': '.$lines[$i]->batch; require_once DOL_DOCUMENT_ROOT.'/product/stock/productlot.class.php';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $productlot = new Productlot($db);
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($lines[$i]->sellby, "day"); $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 $detail . '</td>';
print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail);
} else {
print $langs->trans("NA");
}
print '</td>';
} else { } else {
print '<td></td>'; print '<td></td>';
} }