2
0
forked from Wavyzz/dolibarr

FIX pagebreak when option PDF_ADD_POSITION is set

This commit is contained in:
Laurent Destailleur
2024-10-18 18:43:59 +02:00
parent 8f868ef3b9
commit f9eb82de7f
5 changed files with 22 additions and 18 deletions

View File

@@ -557,10 +557,6 @@ class pdf_eratosthene extends ModelePDFCommandes
$posYAfterImage = 0; $posYAfterImage = 0;
$posYAfterDescription = 0; $posYAfterDescription = 0;
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
if ($this->getColumnStatus('photo')) { if ($this->getColumnStatus('photo')) {
// We start with Photo of product line // We start with Photo of product line
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 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
@@ -644,6 +640,11 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
// # of line
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
// VAT Rate // VAT Rate
if ($this->getColumnStatus('vat')) { if ($this->getColumnStatus('vat')) {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);

View File

@@ -574,10 +574,6 @@ class pdf_espadon extends ModelePdfExpedition
$posYAfterDescription = 0; $posYAfterDescription = 0;
$heightforsignature = 0; $heightforsignature = 0;
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
}
if ($this->getColumnStatus('photo')) { if ($this->getColumnStatus('photo')) {
// We start with Photo of product line // We start with Photo of product line
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // If photo too high, we moved completely on new page if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // If photo too high, we moved completely on new page
@@ -666,8 +662,12 @@ class pdf_espadon extends ModelePdfExpedition
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
// weight // # of line
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
// weight
$weighttxt = ''; $weighttxt = '';
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) { if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) {
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1); $weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);

View File

@@ -714,10 +714,6 @@ class pdf_sponge extends ModelePDFFactures
$posYAfterImage = 0; $posYAfterImage = 0;
$posYAfterDescription = 0; $posYAfterDescription = 0;
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
if ($this->getColumnStatus('photo')) { if ($this->getColumnStatus('photo')) {
// We start with Photo of product line // We start with Photo of product line
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - $page_bottom_margin)) { // If photo too high, we moved completely on new page if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - $page_bottom_margin)) { // If photo too high, we moved completely on new page
@@ -799,6 +795,11 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
// # of line
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
// VAT Rate // VAT Rate
if ($this->getColumnStatus('vat')) { if ($this->getColumnStatus('vat')) {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);

View File

@@ -650,7 +650,7 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font $pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
// Position // # of line
if ($this->getColumnStatus('position')) { if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1); $this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
} }

View File

@@ -519,10 +519,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$posYAfterImage = 0; $posYAfterImage = 0;
$posYAfterDescription = 0; $posYAfterDescription = 0;
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
}
// We start with Photo of product line // We start with Photo of product line
if ($this->getColumnStatus('photo')) { if ($this->getColumnStatus('photo')) {
// We start with Photo of product line // We start with Photo of product line
@@ -549,6 +545,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$posYAfterImage = $curY + $imglinesize['height']; $posYAfterImage = $curY + $imglinesize['height'];
} }
} }
// Description of product line // Description of product line
$curX = $this->posxdesc - 1; $curX = $this->posxdesc - 1;
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
@@ -604,6 +601,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default
// # of line
if ($this->getColumnStatus('position')) {
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
}
// VAT Rate // VAT Rate
if ($this->getColumnStatus('vat')) { if ($this->getColumnStatus('vat')) {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);