FIX: Show product photo on Supplier order Cornas model.

This commit is contained in:
Francis Appels 2022-02-26 11:13:02 +01:00
parent a2dea71b4d
commit 3e41c9cb97

View File

@ -546,31 +546,30 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$posYAfterDescription = 0; $posYAfterDescription = 0;
// We start with Photo of product line // We start with Photo of product line
if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page if ($this->getColumnStatus('photo')) {
$pdf->AddPage('', '', true); // We start with Photo of product line
if (!empty($tplidx)) { if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page
$pdf->useTemplate($tplidx); $pdf->AddPage('', '', true);
} if (!empty($tplidx)) {
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) { $pdf->useTemplate($tplidx);
$this->_pagehead($pdf, $object, 0, $outputlangs); }
} $pdf->setPage($pageposbefore + 1);
$pdf->setPage($pageposbefore + 1);
$curY = $tab_top_newpage; $curY = $tab_top_newpage;
// Allows data in the first page if description is long enough to break in multiples pages // Allows data in the first page if description is long enough to break in multiples pages
if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) { if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
} else { } else {
$showpricebeforepagebreak = 0; $showpricebeforepagebreak = 0;
}
} }
}
if (!empty($imglinesize['width']) && !empty($imglinesize['height'])) { if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) {
$curX = $this->posxpicture - 1; $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi
$pdf->Image($realpatharray[$i], $curX + (($this->posxtva - $this->posxpicture - $imglinesize['width']) / 2), $curY, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi // $pdf->Image does not increase value return by getY, so we save it manually
// $pdf->Image does not increase value return by getY, so we save it manually $posYAfterImage = $curY + $imglinesize['height'];
$posYAfterImage = $curY + $imglinesize['height']; }
} }
// Description of product line // Description of product line
$curX = $this->posxdesc - 1; $curX = $this->posxdesc - 1;