Make validation use exact same PDF generation as export

This commit is contained in:
Frank Cools 2025-10-08 14:20:40 +02:00
parent 7095c8611a
commit f7c318f1d6

View File

@ -340,8 +340,20 @@ class DeclarationTVA_PDF
$filepath = $month_dir . $filename; $filepath = $month_dir . $filename;
// Use the same method as export // Use the exact same method as export but with the correct output path
return $this->generateCompleteCA3PDF($declaration_id, $filepath, 'validation', $outputlangs); // First generate the PDF using the same method as export
$temp_pdf = $this->generateCA3PDF($declaration_id, $outputlangs);
if ($temp_pdf && file_exists($temp_pdf)) {
// Copy the generated PDF to the validation location
if (copy($temp_pdf, $filepath)) {
// Clean up the temporary file
unlink($temp_pdf);
return $filepath;
}
}
return false;
} }
/** /**