This commit is contained in:
Laurent Destailleur 2020-06-16 21:57:49 +02:00
parent b7d835eceb
commit cbd99ea7a2

View File

@ -928,7 +928,7 @@ if ($id > 0 || !empty($ref)) {
</script>';
// List of lines already dispatched
$sql = "SELECT p.ref, p.label,";
$sql = "SELECT p.rowid as pid, p.ref, p.label,";
$sql .= " e.rowid as warehouse_id, e.ref as entrepot,";
$sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status, cfd.datec";
if ($conf->reception->enabled)$sql .= " ,cfd.fk_reception, r.date_delivery";
@ -1005,9 +1005,18 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.dol_print_date($db->jdate($objp->date_delivery), 'day').'</td>';
if (!empty($conf->productbatch->enabled)) {
print '<td class="dispatch_batch_number">'.$objp->batch.'</td>';
print '<td class="dispatch_dluo">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
print '<td class="dispatch_dlc">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
if ($objp->batch) {
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
$lot=new Productlot($db);
$lot->fetch(0, $objp->pid, $objp->batch);
print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>';
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
print '<td class="dispatch_dlc">'.dol_print_date($lot->sellby, 'day').'</td>';
} else {
print '<td class="dispatch_batch_number"></td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
}
}
// Qty