Refactor Template Engine

This commit is contained in:
David Bomba 2020-10-28 16:50:06 +11:00
parent 064f7d98ef
commit a07f04e1df
4 changed files with 11 additions and 2 deletions

View File

@ -69,6 +69,7 @@ class Company extends BaseModel
protected $presenter = \App\Models\Presenters\CompanyPresenter::class;
protected $fillable = [
'show_tasks_table',
'mark_expenses_invoiceable',
'mark_expenses_paid',
'enabled_item_tax_rates',

View File

@ -154,7 +154,7 @@ class CompanyTransformer extends EntityTransformer
'invoice_task_timelog' => (bool) $company->invoice_task_timelog,
'auto_start_tasks' => (bool) $company->auto_start_tasks,
'invoice_task_documents' => (bool) $company->invoice_task_documents,
// 'use_credits_payment' => 'always', //todo remove
'use_credits_payment' => 'always', //todo remove
];
}

View File

@ -16,6 +16,7 @@ use App\Models\Client;
use App\Models\ClientContact;
use App\Models\Invoice;
use App\Models\InvoiceInvitation;
use App\Utils\HtmlEngine;
use App\Utils\Traits\MakesHash;
use App\Utils\Traits\MakesInvoiceHtml;
use App\Utils\Traits\MakesTemplateData;
@ -151,7 +152,9 @@ class TemplateEngine
private function entityValues($contact)
{
$data = $this->entity_obj->buildLabelsAndValues($contact);
//$data = $this->entity_obj->buildLabelsAndValues($contact);
$data = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
// $arrKeysLength = array_map('strlen', array_keys($data));
// array_multisort($arrKeysLength, SORT_DESC, $data);

View File

@ -16,6 +16,11 @@ class TasksInvoiceDocuments extends Migration
Schema::table('tasks', function(Blueprint $table){
$table->boolean('invoice_documents')->default(0);
});
Schema::table('companies', function(Blueprint $table){
$table->boolean('show_tasks_table')->default();
});
}
/**