diff --git a/app/Models/Client.php b/app/Models/Client.php index 28727d9f3673..9543376a0f99 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -834,7 +834,6 @@ class Client extends BaseModel implements HasLocalePreference return 0; $timezone = $this->company->timezone(); - $offset -= $timezone->utc_offset; $offset += ($entity_send_time * 3600); diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 00dbe7962327..5dc5fe204eba 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -152,6 +152,11 @@ class Invoice extends BaseModel return $this->belongsTo(Project::class); } + public function vendor() + { + return $this->belongsTo(Vendor::class); + } + public function design() { return $this->belongsTo(Design::class); diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 52a75173d726..3e659cb3024f 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -153,6 +153,10 @@ class HtmlEngine $data['$project.name'] = ['value' => $this->entity->project->name, 'label' => ctrans('texts.project_name')]; $data['$invoice.project'] = &$data['$project.name']; } + + if($this->entity->vendor) { + $data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')]; + } } if ($this->entity_string == 'quote') {