diff --git a/ChangeLog.md b/ChangeLog.md index 0943175..1b3a62d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.31 + +### Bug Fixes +- **Fixed Export PDF Generation**: Fixed return value handling in unified PDF generation method +- **Correct File Path Return**: Export now correctly returns file path instead of boolean +- **Error Handling**: Improved error handling for PDF generation failures +- **Export Functionality**: Export now works correctly with both fillable and improved layouts + ## 2.5.30 ### Major Refactoring diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 1df28e2..9d30a5d 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -192,12 +192,14 @@ class DeclarationTVA_PDF $template_file = $this->getTemplatePath(); if ($template_file && file_exists($template_file) && $this->isFillablePDF($template_file)) { // Use fillable PDF template for export - return $this->fillFillablePDF($template_file, $output_path, $declaration, $ca3_data, $mysoc); + $result = $this->fillFillablePDF($template_file, $output_path, $declaration, $ca3_data, $mysoc); + return $result ? $output_path : false; } } // For validation or when no fillable template exists, use improved layout - return $this->generateImprovedPDF($output_path, $declaration, $ca3_data, $mysoc); + $result = $this->generateImprovedPDF($output_path, $declaration, $ca3_data, $mysoc); + return $result ? $output_path : false; } /** diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index fa12a15..14b0697 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.30'; + $this->version = '2.5.31'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';