From a8b2f19bae5362ddf3dd3b112150cf5ae3fd4442 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 13:09:50 +0200 Subject: [PATCH] v2.5.22: Enhanced footer with total page count - Footer now displays 'Page X/Y' format (e.g., 'Page 1/7') - Professional PDF layout with total page count for better document navigation - Users can now see current page and total pages in footer - Enhanced footer provides complete page information - Updated module version to 2.5.22 --- ChangeLog.md | 8 ++++++++ core/class/declarationtva_pdf.class.php | 10 ++++++---- core/modules/modDeclarationTVA.class.php | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 046bd11..688be1d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.22 + +### Bug Fixes +- **Enhanced Footer with Total Pages**: Footer now displays "Page X/Y" format (e.g., "Page 1/7") +- **Professional PDF Layout**: Added total page count to footer for better document navigation +- **Improved User Experience**: Users can now see current page and total pages in footer +- **Better Document Management**: Enhanced footer provides complete page information + ## 2.5.21 ### Bug Fixes diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index bef67ba..0d8e3a7 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -50,8 +50,9 @@ class DeclarationTVA_CustomPDF extends TCPDF // Set font size 7 (same as summary information) $this->SetFont('helvetica', '', 7); - // Get current page number + // Get current page number and total pages $page_number = $this->getPage(); + $total_pages = $this->getNumPages(); // Get page width for positioning $page_width = $this->getPageWidth(); @@ -62,9 +63,10 @@ class DeclarationTVA_CustomPDF extends TCPDF $this->SetXY($margin_left, $this->GetY()); $this->Cell(0, 6, $this->company_name, 0, 0, 'L'); - // Page number on the right - $this->SetXY($page_width - $margin_right - 20, $this->GetY()); - $this->Cell(20, 6, 'Page ' . $page_number, 0, 0, 'R'); + // Page number with total pages on the right (e.g., "Page 1/7") + $page_text = 'Page ' . $page_number . '/' . $total_pages; + $this->SetXY($page_width - $margin_right - 30, $this->GetY()); + $this->Cell(30, 6, $page_text, 0, 0, 'R'); } } diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index 7192a20..a0d43bc 100644 --- a/core/modules/modDeclarationTVA.class.php +++ b/core/modules/modDeclarationTVA.class.php @@ -76,7 +76,7 @@ class modDeclarationTVA extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@declarationtva' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '2.5.21'; + $this->version = '2.5.22'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';