Make validation use exact same PDF generation as export
This commit is contained in:
parent
7095c8611a
commit
f7c318f1d6
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user