From 1489fdcb847f3d5e5daa80eb62906f9b4049d1b4 Mon Sep 17 00:00:00 2001 From: atm-jonathan Date: Fri, 17 Jul 2026 17:24:57 +0200 Subject: [PATCH] FIX : Show order line comment as tooltip during reception dispatch The supplier order line description (free-text comment used to detail generic products) was fetched by neither the reception module nor the legacy dispatch screen, making it impossible to tell similar lines apart when receiving. Select l.description and expose it as a tooltip on the product name, reusing the same textwithtooltip helper as the order line display. --- htdocs/fourn/commande/dispatch.php | 8 ++++---- htdocs/reception/dispatch.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index f74b838b97d53..6920ec7475b62 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -690,7 +690,7 @@ } //$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,"; - $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,"; + $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty, l.description,"; $sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse"; // Enable hooks to alter the SQL query (SELECT) @@ -816,9 +816,6 @@ if ($remaintodispatch || !getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) { $nbproduct++; - // To show detail cref and description value, we must make calculation by cref - // print ($objp->cref?' ('.$objp->cref.')':''); - // if ($objp->description) print '
'.nl2br($objp->description); $suffix = '_0_'.$i; print "\n"; @@ -838,6 +835,9 @@ $linktoprod = $tmpproduct->getNomUrl(1); $linktoprod .= ' - '.$objp->label."\n"; + if (!empty($objp->description) && $objp->description != $objp->label) { + $linktoprod = $form->textwithtooltip($linktoprod, dol_htmlentitiesbr($objp->description)); + } if (isModEnabled('productbatch')) { if ($objp->tobatch) { diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index ccfb08f1b5ffe..eb68b9eaf0f57 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -483,7 +483,7 @@ //$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,"; - $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,"; + $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty, l.description,"; $sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse"; // Enable hooks to alter the SQL query (SELECT) $parameters = array(); @@ -609,9 +609,6 @@ if ($remaintodispatch || !getDolGlobalString('SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED')) { $nbproduct++; - // To show detail cref and description value, we must make calculation by cref - // print ($objp->cref?' ('.$objp->cref.')':''); - // if ($objp->description) print '
'.nl2br($objp->description); $suffix = '_0_'.$i; print "\n"; @@ -631,6 +628,9 @@ $linktoprod = $tmpproduct->getNomUrl(1); $linktoprod .= ' - '.$objp->label."\n"; + if (!empty($objp->description) && $objp->description != $objp->label) { + $linktoprod = $form->textwithtooltip($linktoprod, dol_htmlentitiesbr($objp->description)); + } if (isModEnabled('productbatch')) { if ($objp->tobatch) {