From 15d4fb34b6b88a542c1805052eac20170450eff4 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Mon, 6 Oct 2025 18:01:37 +0200 Subject: [PATCH] Fix PDF file paths to remove duplicate /documents - Changed PDF generation path from /documents/declarationtva/validated/ to /declarationtva/validated/ - Updated hasValidatedDocument() to look in /declarationtva/validated/ - Updated getValidatedPDFPath() to look in /declarationtva/validated/ - This removes the duplicate /documents in the file path - Files will now be saved in /var/lib/dolibarr/declarationtva/validated/ - URLs will be /dolibarr/documents/declarationtva/validated/ (single /documents) --- core/class/declarationtva.class.php | 4 ++-- core/class/declarationtva_pdf.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index d11ddba..4ef419e 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -1262,7 +1262,7 @@ class DeclarationTVA } // Check if PDF file exists in the VAT declarations directory - $vat_declarations_dir = DOL_DATA_ROOT . '/documents/declarationtva/validated/'; + $vat_declarations_dir = DOL_DATA_ROOT . '/declarationtva/validated/'; // Look for PDF files with the declaration number $pattern = $vat_declarations_dir . 'CA3_' . $obj->declaration_number . '_*.pdf'; @@ -1302,7 +1302,7 @@ class DeclarationTVA } // Check if PDF file exists in the VAT declarations directory - $vat_declarations_dir = DOL_DATA_ROOT . '/documents/declarationtva/validated/'; + $vat_declarations_dir = DOL_DATA_ROOT . '/declarationtva/validated/'; // Look for PDF files with the declaration number $pattern = $vat_declarations_dir . 'CA3_' . $obj->declaration_number . '_*.pdf'; diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 4d96379..b31105b 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -184,7 +184,7 @@ class DeclarationTVA_PDF $filename = 'CA3_' . $declaration->declaration_number . '_' . date('Y-m-d') . '.pdf'; // Create VAT declarations documents directory structure - $vat_declarations_dir = DOL_DATA_ROOT . '/documents/declarationtva/validated/'; + $vat_declarations_dir = DOL_DATA_ROOT . '/declarationtva/validated/'; // Create directory if it doesn't exist if (!is_dir($vat_declarations_dir)) {