From 18256e0cff88b7efafe0d234129162a6aafc69b0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 19 Apr 2024 11:21:00 +1000 Subject: [PATCH] Attempt to find a stubbed invoice/quote for template --- app/Services/Template/TemplateService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];