diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index e5a55fb19..5907397b7 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -204,6 +204,7 @@ class PreviewController extends BaseController if($request->has('entity_id')){ $entity_obj = $class::on(config('database.default')) + ->with('client.contacts.company') ->where('id', $this->decodePrimaryKey($request->input('entity_id'))) ->where('company_id', $company->id) ->withTrashed() @@ -216,7 +217,7 @@ class PreviewController extends BaseController if(!$request->has('entity_id')) $entity_obj->service()->fillDefaults()->save(); - $entity_obj->load('client.contacts','company'); + // $entity_obj->load('client.contacts','client.company'); App::forgetInstance('translator'); $t = app('translator'); diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 55754f834..dd0977a55 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -449,6 +449,8 @@ class InvoiceService public function fillDefaults() { + $this->invoice->load('client.company'); + $settings = $this->invoice->client->getMergedSettings(); if (! $this->invoice->design_id)