diff --git a/app/Services/Template/TemplateService.php b/app/Services/Template/TemplateService.php index 020ecf739eb3..8af23142ba94 100644 --- a/app/Services/Template/TemplateService.php +++ b/app/Services/Template/TemplateService.php @@ -207,7 +207,7 @@ class TemplateService $tm = new TemplateMock($this->company); $tm->setSettings($this->getSettings())->init(); - $this->entity = $this->company->invoices()->first(); + $this->entity = $this->company->invoices()->first() ?? $this->company->quotes()->first(); $this->data = $tm->engines; $this->variables = $tm->variables[0];