Add debugging to template path resolution

- Added debug logging to see what template path is being used
- This will help identify if the path is correct or if files are missing
- Should show exactly where the system is looking for template files
This commit is contained in:
Frank Cools 2025-10-07 15:24:22 +02:00
parent 40fa2b2f73
commit aa56cf4640

View File

@ -229,18 +229,25 @@ class DeclarationTVA_PDF
*/
private function getTemplatePath()
{
error_log("DeclarationTVA: Template path: " . $this->template_path);
// Check for custom template first
$custom_template = $this->template_path . 'ca3_custom_template.pdf';
error_log("DeclarationTVA: Looking for custom template: " . $custom_template);
if (file_exists($custom_template)) {
error_log("DeclarationTVA: Custom template found");
return $custom_template;
}
// Fall back to default template
$default_template = $this->template_path . 'ca3_official_template.pdf';
error_log("DeclarationTVA: Looking for default template: " . $default_template);
if (file_exists($default_template)) {
error_log("DeclarationTVA: Default template found");
return $default_template;
}
error_log("DeclarationTVA: No template found");
return false;
}