diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 5369a38..53f98b3 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1535,10 +1535,16 @@ class DeclarationTVA_PDF ); try { - // Fetch manifest from Gitea - $manifest_content = file_get_contents($this->manifest_url); + // Use local manifest file instead of fetching from Gitea + $local_manifest = DOL_DOCUMENT_ROOT.'/custom/declarationtva/templates/manifest.json'; + if (!file_exists($local_manifest)) { + $update_info['error'] = 'Local manifest file not found'; + return $update_info; + } + + $manifest_content = file_get_contents($local_manifest); if ($manifest_content === false) { - $update_info['error'] = 'Failed to fetch manifest from Gitea'; + $update_info['error'] = 'Failed to read local manifest file'; return $update_info; } @@ -1586,10 +1592,16 @@ class DeclarationTVA_PDF dol_mkdir($this->template_path); } - // Download template - $template_content = file_get_contents($download_url); + // Use local template file instead of downloading from Gitea + $local_template = DOL_DOCUMENT_ROOT.'/custom/declarationtva/templates/declarationtva/ca3_official_template.pdf'; + if (!file_exists($local_template)) { + $this->error = 'Local template file not found'; + return false; + } + + $template_content = file_get_contents($local_template); if ($template_content === false) { - $this->error = 'Failed to download template from Gitea'; + $this->error = 'Failed to read local template file'; return false; }