From f8884d2c86bd532b8c937aeaafc4ad7fc956b88e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 27 Dec 2021 15:00:05 +0100 Subject: [PATCH] fix : units were not displayed --- .../core/modules/product/doc/pdf_standard.modules.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 37aca08d146..940aa1d4279 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -293,18 +293,21 @@ class pdf_standard extends ModelePDFProduct $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); $nexY = $pdf->GetY(); } - if ($object->weight) { - $texttoshow = $langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").': '.($object->length != '' ? $object->length : '?').' x '.($object->width != '' ? $object->width : '?').' x '.($object->height != '' ? $object->height : '?'); + if ($object->length) { + $texttoshow = $langs->trans("Length") . ' x ' . $langs->trans("Width") . ' x ' . $langs->trans("Height") . ': ' . ($object->length != '' ? $object->length : '?') . ' x ' . ($object->width != '' ? $object->width : '?') . ' x ' . ($object->height != '' ? $object->height : '?'); + $texttoshow .= ' ' . measuringUnitString(0, "size", $object->length_units); $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); $nexY = $pdf->GetY(); } if ($object->surface) { - $texttoshow = $langs->trans("Area").': '.dol_htmlentitiesbr($object->surface); + $texttoshow = $langs->trans("Surface") . ': ' . dol_htmlentitiesbr($object->surface); + $texttoshow .= ' ' . measuringUnitString(0, "surface", $object->surface_units); $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); $nexY = $pdf->GetY(); } if ($object->volume) { - $texttoshow = $langs->trans("Volume").': '.dol_htmlentitiesbr($object->volume); + $texttoshow = $langs->trans("Volume") . ': ' . dol_htmlentitiesbr($object->volume); + $texttoshow .= ' ' . measuringUnitString(0, "volume", $object->volume_units); $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $texttoshow, 0, 1); $nexY = $pdf->GetY(); }