From 4400b83f9c35f6d16df227be1a47e73c72fda950 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 14:42:15 +0200 Subject: [PATCH] Remove old generateDetailedPDF method that was causing confusion --- core/class/declarationtva_pdf.class.php | 68 ------------------------- 1 file changed, 68 deletions(-) diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 7ec2a0f..6174196 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1588,74 +1588,6 @@ class DeclarationTVA_PDF return 2; // Start from page 2 (after main form) } - /** - * Generate detailed PDF with breakdown pages - * - * @param string $output_path Output file path - * @param DeclarationTVA $declaration Declaration object - * @param array $ca3_data CA-3 line data - * @param Societe $company Company object - * @return bool Success - */ - private function generateDetailedPDF($output_path, $declaration, $ca3_data, $mysoc) - { - try { - // Create a new PDF document - $pdf = new DeclarationTVA_CustomPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); - - // Set company name and declaration period for footer - $pdf->setCompanyName($mysoc->name); - $pdf->setDeclarationPeriod(dol_print_date($declaration->start_date, 'day') . ' - ' . dol_print_date($declaration->end_date, 'day')); - - // Set document information - $pdf->SetCreator('DeclarationTVA Module'); - $pdf->SetAuthor($mysoc->name); - $pdf->SetTitle('CA-3 Declaration Details ' . $declaration->declaration_number); - $pdf->SetSubject('French VAT Declaration - Detailed Breakdown'); - - // Set margins - $pdf->SetMargins(15, 15, 15); - $pdf->SetHeaderMargin(5); - $pdf->SetFooterMargin(10); - - // Set thin borders for all elements - $pdf->SetLineWidth(0.1); - - // Add title page - $pdf->AddPage(); - $pdf->SetFont('helvetica', 'B', 16); - $pdf->SetFillColor(240, 240, 240); // Light gray background - $pdf->Cell(0, 10, 'Détails de la Déclaration TVA CA-3', 1, 1, 'C', true); - $pdf->Ln(10); - - $pdf->SetFont('helvetica', '', 12); - $pdf->Cell(0, 8, 'Numéro de déclaration: ' . $declaration->declaration_number, 0, 1); - $pdf->Cell(0, 8, 'Période: ' . dol_print_date($declaration->start_date, 'day') . ' - ' . dol_print_date($declaration->end_date, 'day'), 0, 1); - $pdf->Cell(0, 8, 'Statut: ' . $this->translateStatus($declaration->status), 0, 1); - $pdf->Ln(10); - - // Add journal entry table on page 1 - $this->addJournalEntryTable($pdf, $declaration, $ca3_data); - - // Add bank journal entry table on page 1 - $this->addBankJournalEntryTable($pdf, $declaration, $ca3_data); - - // Add detailed breakdown pages starting on page 2 - $this->addDetailedPagesContent($pdf, $declaration, $ca3_data); - - // Set total pages for footer after all pages are generated - $pdf->setTotalPages($pdf->getNumPages()); - - // Output PDF - $pdf->Output($output_path, 'F'); - - return true; - - } catch (Exception $e) { - $this->error = 'Detailed PDF generation failed: ' . $e->getMessage(); - return false; - } - } /** * Upload custom template