From 8792b261f7d7223718e2f03557ea087abb2a0200 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 13:23:18 +0200 Subject: [PATCH] v2.5.26: Added declaration period to footer - Footer now displays declaration period centered between company name and page number - Enhanced footer information with company name, declaration period, and page count - Professional PDF layout with complete footer information - Declaration period helps identify the document period - Updated module version to 2.5.26 --- ChangeLog.md | 8 ++++++++ core/class/declarationtva_pdf.class.php | 18 ++++++++++++++++-- core/modules/modDeclarationTVA.class.php | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 447c3ca..52a764c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.26 + +### Bug Fixes +- **Added Declaration Period to Footer**: Footer now displays declaration period centered between company name and page number +- **Enhanced Footer Information**: Footer now shows company name, declaration period, and page count +- **Professional PDF Layout**: Complete footer with all relevant information +- **Better Document Identification**: Declaration period helps identify the document period + ## 2.5.25 ### Bug Fixes diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index f9bb602..fb81525 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -40,12 +40,18 @@ class DeclarationTVA_CustomPDF extends TCPDF { private $company_name = ''; private $total_pages = 0; + private $declaration_period = ''; public function setCompanyName($company_name) { $this->company_name = $company_name; } + public function setDeclarationPeriod($period) + { + $this->declaration_period = $period; + } + public function setTotalPages($total_pages) { $this->total_pages = $total_pages; @@ -73,6 +79,12 @@ class DeclarationTVA_CustomPDF extends TCPDF $this->SetXY($margin_left, $this->GetY()); $this->Cell(0, 6, $this->company_name, 0, 0, 'L'); + // Declaration period centered + if (!empty($this->declaration_period)) { + $this->SetXY($margin_left, $this->GetY()); + $this->Cell($page_width - $margin_left - $margin_right, 6, $this->declaration_period, 0, 0, 'C'); + } + // Page number with total pages on the right using alias system $this->SetXY($page_width - $margin_right - 30, $this->GetY()); $this->Cell(30, 6, 'Page ' . $page_number . '/' . $this->getAliasNbPages(), 0, 0, 'R'); @@ -857,8 +869,9 @@ class DeclarationTVA_PDF // Create a new PDF document $pdf = new DeclarationTVA_CustomPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); - // Set company name for footer + // Set company name and declaration period for footer $pdf->setCompanyName($mysoc->name); + $pdf->setDeclarationPeriod(dol_print_date($declaration->start_date, 'day') . ' - ' . dol_print_date($declaration->end_date, 'day')); // Set document information $pdf->SetCreator('DeclarationTVA Module'); @@ -1523,8 +1536,9 @@ class DeclarationTVA_PDF // Create a new PDF document $pdf = new DeclarationTVA_CustomPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); - // Set company name for footer + // Set company name and declaration period for footer $pdf->setCompanyName($mysoc->name); + $pdf->setDeclarationPeriod(dol_print_date($declaration->start_date, 'day') . ' - ' . dol_print_date($declaration->end_date, 'day')); // Set document information $pdf->SetCreator('DeclarationTVA Module'); diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index 8e4d112..a28f4c0 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.25'; + $this->version = '2.5.26'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';