From 6e9f620925075abbe8bf1698a8149c6666bc19ec Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Mon, 6 Oct 2025 18:11:31 +0200 Subject: [PATCH] Remove separate detailed PDF export button - Removed 'Export Detailed PDF' button from view page - Removed export_pdf_detailed action handler - Detailed export is now integrated into main 'Export PDF' button - Simplifies UI by having single PDF export option - Main export now includes both CA-3 form and detailed breakdown pages --- declarationtva_view.php | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/declarationtva_view.php b/declarationtva_view.php index 4ca0b31..4dd9c13 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -76,27 +76,6 @@ if ($action == 'export_pdf') { } } -if ($action == 'export_pdf_detailed') { - // Load PDF generator - require_once DOL_DOCUMENT_ROOT . '/custom/declarationtva/core/class/declarationtva_pdf.class.php'; - $pdf_generator = new DeclarationTVA_PDF($db); - - // Generate detailed PDF with breakdown pages - $pdf_path = $pdf_generator->generateDetailedCA3PDF($id); - - if ($pdf_path && file_exists($pdf_path)) { - // Set headers for PDF download - header('Content-Type: application/pdf'); - header('Content-Disposition: attachment; filename="CA3_Detailed_' . $declarationtva->declaration_number . '.pdf"'); - header('Content-Length: ' . filesize($pdf_path)); - - // Output PDF file - readfile($pdf_path); - exit; - } else { - setEventMessages($pdf_generator->error ?: $langs->trans("ErrorGeneratingDetailedPDF"), null, 'errors'); - } -} if ($action == 'validate' && $token) { // Validate the declaration @@ -469,9 +448,8 @@ if ($declarationtva->status == 'draft') { print '' . $langs->trans("Recalculate") . ' '; } -// PDF Export buttons (always available) +// PDF Export button (always available) print '' . $langs->trans("ExportPDF") . ' '; -print '' . $langs->trans("ExportPDFDetailed") . ' '; if ($declarationtva->status == 'draft') { // Validation button with confirmation dialog