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
This commit is contained in:
parent
64f5278e2b
commit
6e9f620925
@ -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) {
|
if ($action == 'validate' && $token) {
|
||||||
// Validate the declaration
|
// Validate the declaration
|
||||||
@ -469,9 +448,8 @@ if ($declarationtva->status == 'draft') {
|
|||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&action=recalculate&token=' . newToken() . '" class="butAction">' . $langs->trans("Recalculate") . '</a> ';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&action=recalculate&token=' . newToken() . '" class="butAction">' . $langs->trans("Recalculate") . '</a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDF Export buttons (always available)
|
// PDF Export button (always available)
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&action=export_pdf" class="butAction">' . $langs->trans("ExportPDF") . '</a> ';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&action=export_pdf" class="butAction">' . $langs->trans("ExportPDF") . '</a> ';
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '&action=export_pdf_detailed" class="butAction">' . $langs->trans("ExportPDFDetailed") . '</a> ';
|
|
||||||
|
|
||||||
if ($declarationtva->status == 'draft') {
|
if ($declarationtva->status == 'draft') {
|
||||||
// Validation button with confirmation dialog
|
// Validation button with confirmation dialog
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user