Fix PDF generation to include CA-3 form with details

- Changed generateDetailedCA3PDF to call generateCA3PDF instead of generateDetailedPDF
- generateCA3PDF creates complete PDF with CA-3 form + detailed breakdown pages
- generateDetailedPDF only creates detailed pages without the CA-3 form
- Now generates complete PDF with both CA-3 form and account details
- Copies generated PDF to correct validated directory location
This commit is contained in:
Frank Cools 2025-10-06 17:54:53 +02:00
parent d6de5c6c0b
commit c1aa501898

View File

@ -193,8 +193,20 @@ class DeclarationTVA_PDF
$filepath = $vat_declarations_dir . $filename;
// Generate detailed PDF with breakdown pages
$result = $this->generateDetailedPDF($filepath, $declaration, $ca3_data, $company);
// Generate complete PDF with CA-3 form and detailed breakdown pages
$result = $this->generateCA3PDF($declaration_id);
if ($result && file_exists($result)) {
// Copy the generated PDF to our target location
if (copy($result, $filepath)) {
// Clean up the temporary file
unlink($result);
$result = true;
} else {
$this->error = "Failed to copy PDF to target location";
$result = false;
}
}
if ($result) {
// Verify file was actually created