mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for templates
This commit is contained in:
parent
3499ad885c
commit
0ac5acda82
@ -84,6 +84,10 @@ class TemplateEngine
|
|||||||
|
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ($this->template == 'email_template_null')
|
||||||
|
$this->template = 'email_template_purchase_order';
|
||||||
|
|
||||||
return $this->setEntity()
|
return $this->setEntity()
|
||||||
->setSettingsObject()
|
->setSettingsObject()
|
||||||
->setTemplates()
|
->setTemplates()
|
||||||
@ -156,7 +160,7 @@ class TemplateEngine
|
|||||||
if($this->entity == 'purchaseOrder'){
|
if($this->entity == 'purchaseOrder'){
|
||||||
$this->fakerValues();
|
$this->fakerValues();
|
||||||
}
|
}
|
||||||
elseif ($this->entity_obj) {
|
elseif ($this->entity_obj->client()->exists()) {
|
||||||
$this->entityValues($this->entity_obj->client->primary_contact()->first());
|
$this->entityValues($this->entity_obj->client->primary_contact()->first());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -186,7 +190,7 @@ class TemplateEngine
|
|||||||
|
|
||||||
private function entityValues($contact)
|
private function entityValues($contact)
|
||||||
{
|
{
|
||||||
if($this->entity == 'purchase_order')
|
if($this->entity == 'purchaseOrder')
|
||||||
$this->labels_and_values = (new VendorHtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
$this->labels_and_values = (new VendorHtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||||
else
|
else
|
||||||
$this->labels_and_values = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
$this->labels_and_values = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||||
@ -214,7 +218,7 @@ class TemplateEngine
|
|||||||
$data['footer'] = '';
|
$data['footer'] = '';
|
||||||
$data['logo'] = auth()->user()->company()->present()->logo();
|
$data['logo'] = auth()->user()->company()->present()->logo();
|
||||||
|
|
||||||
if($this->entity_obj->client)
|
if($this->entity_obj->client()->exists())
|
||||||
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
||||||
else{
|
else{
|
||||||
|
|
||||||
@ -323,7 +327,7 @@ class TemplateEngine
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($this->entity == 'purchase_order')
|
if($this->entity == 'purchaseOrder')
|
||||||
{
|
{
|
||||||
|
|
||||||
$vendor = Vendor::factory()->create([
|
$vendor = Vendor::factory()->create([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user