Skip to content

Commit f9eb82d

Browse files
committed
FIX pagebreak when option PDF_ADD_POSITION is set
1 parent 8f868ef commit f9eb82d

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -557,10 +557,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
557557
$posYAfterImage = 0;
558558
$posYAfterDescription = 0;
559559

560-
if ($this->getColumnStatus('position')) {
561-
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
562-
}
563-
564560
if ($this->getColumnStatus('photo')) {
565561
// We start with Photo of product line
566562
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 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
644640

645641
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
646642

643+
// # of line
644+
if ($this->getColumnStatus('position')) {
645+
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
646+
}
647+
647648
// VAT Rate
648649
if ($this->getColumnStatus('vat')) {
649650
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);

htdocs/core/modules/expedition/doc/pdf_espadon.modules.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
574574
$posYAfterDescription = 0;
575575
$heightforsignature = 0;
576576

577-
if ($this->getColumnStatus('position')) {
578-
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
579-
}
580-
581577
if ($this->getColumnStatus('photo')) {
582578
// We start with Photo of product line
583579
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 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
666662

667663
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
668664

669-
// weight
665+
// # of line
666+
if ($this->getColumnStatus('position')) {
667+
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
668+
}
670669

670+
// weight
671671
$weighttxt = '';
672672
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) {
673673
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);

htdocs/core/modules/facture/doc/pdf_sponge.modules.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,6 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
714714
$posYAfterImage = 0;
715715
$posYAfterDescription = 0;
716716

717-
if ($this->getColumnStatus('position')) {
718-
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
719-
}
720-
721717
if ($this->getColumnStatus('photo')) {
722718
// We start with Photo of product line
723719
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 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
799795

800796
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
801797

798+
// # of line
799+
if ($this->getColumnStatus('position')) {
800+
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
801+
}
802+
802803
// VAT Rate
803804
if ($this->getColumnStatus('vat')) {
804805
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);

htdocs/core/modules/propale/doc/pdf_cyan.modules.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
650650

651651
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
652652

653-
// Position
653+
// # of line
654654
if ($this->getColumnStatus('position')) {
655655
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
656656
}

htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,6 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '',
519519
$posYAfterImage = 0;
520520
$posYAfterDescription = 0;
521521

522-
if ($this->getColumnStatus('position')) {
523-
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
524-
}
525-
526522
// We start with Photo of product line
527523
if ($this->getColumnStatus('photo')) {
528524
// We start with Photo of product line
@@ -549,6 +545,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '',
549545
$posYAfterImage = $curY + $imglinesize['height'];
550546
}
551547
}
548+
552549
// Description of product line
553550
$curX = $this->posxdesc - 1;
554551
$showpricebeforepagebreak = 1;
@@ -604,6 +601,11 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '',
604601

605602
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default
606603

604+
// # of line
605+
if ($this->getColumnStatus('position')) {
606+
$this->printStdColumnContent($pdf, $curY, 'position', $i + 1);
607+
}
608+
607609
// VAT Rate
608610
if ($this->getColumnStatus('vat')) {
609611
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);

0 commit comments

Comments
 (0)