diff --git a/ChangeLog.md b/ChangeLog.md index 07783b2..b1eb0cd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.28 + +### Bug Fixes +- **Fixed Validation PDF Layout**: Validation now uses the same improved PDF generation as export +- **Consistent PDF Layout**: Validation PDF now includes OD and bank journal tables on first page +- **Unified PDF Generation**: Both export and validation now use generateBasicPDF() for consistency +- **Complete PDF Features**: Validation PDF now has all improvements (footer, filtered accounts, etc.) + ## 2.5.27 ### Bug Fixes diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 9d6c524..a423ce5 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -201,7 +201,7 @@ class DeclarationTVA_PDF return false; } - // Generate PDF using FPDI or similar library + // Generate PDF using the improved method with all enhancements $result = $this->fillPDFTemplate($template_file, $filepath, $declaration, $ca3_data, $mysoc); if ($result) { @@ -318,13 +318,9 @@ class DeclarationTVA_PDF private function fillPDFTemplate($template_path, $output_path, $declaration, $ca3_data, $mysoc) { try { - // Check if we have a custom fillable PDF template - if (file_exists($template_path) && $this->isFillablePDF($template_path)) { - return $this->fillFillablePDF($template_path, $output_path, $declaration, $ca3_data, $mysoc); - } else { - // Fall back to basic PDF generation - return $this->generateBasicPDF($output_path, $declaration, $ca3_data, $mysoc); - } + // Always use the improved PDF generation for consistency + // This ensures validation uses the same layout as export + return $this->generateBasicPDF($output_path, $declaration, $ca3_data, $mysoc); } catch (Exception $e) { $this->error = 'PDF generation failed: ' . $e->getMessage(); return false; diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index 4bf5874..fd2cbf5 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.27'; + $this->version = '2.5.28'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';