Add debugging to validation PDF generation
This commit is contained in:
parent
4400b83f9c
commit
1cb9837ae7
@ -344,17 +344,26 @@ class DeclarationTVA_PDF
|
||||
// First generate the PDF using the same method as export
|
||||
$temp_pdf = $this->generateCA3PDF($declaration_id, $outputlangs);
|
||||
|
||||
if ($temp_pdf && file_exists($temp_pdf)) {
|
||||
if (!$temp_pdf) {
|
||||
$this->error = 'Failed to generate temporary PDF: ' . $this->error;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!file_exists($temp_pdf)) {
|
||||
$this->error = 'Temporary PDF file does not exist: ' . $temp_pdf;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copy the generated PDF to the validation location
|
||||
if (copy($temp_pdf, $filepath)) {
|
||||
// Clean up the temporary file
|
||||
unlink($temp_pdf);
|
||||
return $filepath;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->error = 'Failed to copy PDF to validation location: ' . $filepath;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the template file path (custom or default)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user