diff --git a/declarationtvaindex.php b/declarationtvaindex.php index cf14a0c..e33e5fb 100644 --- a/declarationtvaindex.php +++ b/declarationtvaindex.php @@ -148,12 +148,17 @@ if (empty($declarations)) { if ($d['status'] == 'validated') { // Check if document exists $has_document = $declarationtva->hasValidatedDocument($d['rowid']); + error_log("DeclarationTVA List Debug - Declaration ID: " . $d['rowid'] . ", Status: " . $d['status'] . ", Has Document: " . ($has_document ? 'TRUE' : 'FALSE')); + if ($has_document) { $pdf_path = $declarationtva->getValidatedPDFPath($d['rowid']); + error_log("DeclarationTVA List Debug - PDF Path: " . ($pdf_path ? $pdf_path : 'NULL')); + if ($pdf_path) { // Create a download link $relative_path = str_replace(DOL_DATA_ROOT, '', $pdf_path); $download_url = DOL_URL_ROOT . '/documents' . $relative_path; + error_log("DeclarationTVA List Debug - Download URL: " . $download_url); print ''; print ''; print '';