catches for company set

This commit is contained in:
David Bomba 2023-11-29 08:57:43 +11:00
parent b925b536c1
commit b67951d128
2 changed files with 12 additions and 0 deletions

View File

@ -113,6 +113,7 @@ class PdfBuilder
$contents = $this->document->getElementsByTagName('ninja');
$template_service = new TemplateService();
$template_service->setCompany($this->service->company);
$data = $template_service->processData($this->service->options)->getData();
$twig = $template_service->twig;

View File

@ -81,6 +81,17 @@ class PdfMaker
$contents = $this->document->getElementsByTagName('ninja');
$ts = new TemplateService();
if(isset($this->data['template']['entity'])){
try{
$entity = $this->data['template']['entity'];
$ts->setCompany($entity->company);
}
catch(\Exception $e){
}
}
$data = $ts->processData($this->options)->getData();
$twig = $ts->twig;