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:
parent
d6de5c6c0b
commit
c1aa501898
@ -193,8 +193,20 @@ class DeclarationTVA_PDF
|
|||||||
|
|
||||||
$filepath = $vat_declarations_dir . $filename;
|
$filepath = $vat_declarations_dir . $filename;
|
||||||
|
|
||||||
// Generate detailed PDF with breakdown pages
|
// Generate complete PDF with CA-3 form and detailed breakdown pages
|
||||||
$result = $this->generateDetailedPDF($filepath, $declaration, $ca3_data, $company);
|
$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) {
|
if ($result) {
|
||||||
// Verify file was actually created
|
// Verify file was actually created
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user