-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with document generation (quotes/invoices), margin and pagination #28274
Comments
I'm experiencing the same issue with the |
Here is a dirty hack I found (knowing that my propale template is derived from cyan): diff --git a/dolibarr/modeles/propale/pdf_thermigo.modules.php b/dolibarr/modeles/propale/pdf_thermigo.modules.php
index 4ab9c8e..ca9ec4d 100644
--- a/dolibarr/modeles/propale/pdf_thermigo.modules.php
+++ b/dolibarr/modeles/propale/pdf_thermigo.modules.php
@@ -607,6 +607,11 @@ class pdf_thermigo extends ModelePDFPropales
$this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc);
+ // HACK: to handle the case where there is a pagebreak before the description
+ // and the price is written on the previous page.
+ $curYAfterPageBreakWrite = $curY;
+ $getYAfterPageBreakWrite = $pdf->GetY();
+
$pageposafter = $pdf->getPage();
$posyafter = $pdf->GetY();
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
@@ -646,6 +651,13 @@ class pdf_thermigo extends ModelePDFPropales
$curY = $tab_top_newpage;
}
+ // HACK: to handle the case where there is a pagebreak before the description
+ // and the price is written on the previous page.
+ if ($pageposafter > $pageposbefore && $getYAfterPageBreakWrite < $curYAfterPageBreakWrite) {
+ $pdf->setPage($pageposafter);
+ $curY = $tab_top_newpage;
+ }
+
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
// VAT Rate |
Progress on fix here: Issue #29458 |
@fappels, I tried the fix that I believe was included in v19.0.2, and the pagination issue is indeed resolved. However, the price of certain lines written in the footer as described by @ipdeveloppement44 is still present for me. My workaround addresses the issue for proposals with short description items, but it causes the price on the first page to break for items with long descriptions that span multiple pages. Do you have any suggestions on where I should investigate further to resolve this issue? |
Hello @badrbouslikhin , did not notice there were two issue in this report. |
Bug
On document templates, specifically the one for invoices labeled "crabe," the price of certain lines is written in the footer. The second issue is that the pagination is also incorrect. For a 3-page document, the first page shows "1/2," the second page "2/3," and the last page "3/3."
Environment Version
18.0.3
Environment OS
Linux
Environment Web server
Apache
Environment PHP
8.1
Environment Database
MariaDB 10.3.39
Environment URL(s)
No response
Expected and actual behavior
The PDFs are configured to display the price at the top of the line (MAIN_PDF_DATA_ON_FIRST_PAGE = 1). Therefore, if a line starts slightly at the bottom of the previous page, it writes the prices at that level. There is no issue with the description, but in terms of writing prices, they end up in the footer.
The second problem concerns pagination, where for a 3-page document, the first page displays "1/2," the second page "2/3," and the last page "3/3."
Steps to reproduce the behavior
No response
Attached files
Issue with writing the price:
Pagination issue:
The text was updated successfully, but these errors were encountered: