Add debugging to validation PDF generation
This commit is contained in:
parent
4400b83f9c
commit
1cb9837ae7
@ -344,16 +344,25 @@ class DeclarationTVA_PDF
|
|||||||
// First generate the PDF using the same method as export
|
// First generate the PDF using the same method as export
|
||||||
$temp_pdf = $this->generateCA3PDF($declaration_id, $outputlangs);
|
$temp_pdf = $this->generateCA3PDF($declaration_id, $outputlangs);
|
||||||
|
|
||||||
if ($temp_pdf && file_exists($temp_pdf)) {
|
if (!$temp_pdf) {
|
||||||
// Copy the generated PDF to the validation location
|
$this->error = 'Failed to generate temporary PDF: ' . $this->error;
|
||||||
if (copy($temp_pdf, $filepath)) {
|
return false;
|
||||||
// Clean up the temporary file
|
|
||||||
unlink($temp_pdf);
|
|
||||||
return $filepath;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user