Merge pull request #19693 from grandoc/new_branch_27_12_2021

fix : units were not displayed
This commit is contained in:
Laurent Destailleur 2021-12-30 13:19:25 +01:00 committed by GitHub
commit ebb7aa7494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}