mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add vendor relation to invoice
This commit is contained in:
parent
4fe06b8a29
commit
d7e9f64472
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user