mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Refactor PDF Service
This commit is contained in:
parent
390c494348
commit
20097b4fa8
@ -528,7 +528,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
private function preFlightChecksFail(): bool
|
private function preFlightChecksFail(): bool
|
||||||
{
|
{
|
||||||
|
(new \Modules\Admin\Jobs\Account\EmailQuality($this->nmo, $this->company))->run();
|
||||||
/* If we are migrating data we don't want to fire any emails */
|
/* If we are migrating data we don't want to fire any emails */
|
||||||
if($this->company->is_disabled && !$this->override)
|
if($this->company->is_disabled && !$this->override)
|
||||||
return true;
|
return true;
|
||||||
|
@ -63,17 +63,10 @@ class PdfService
|
|||||||
|
|
||||||
$this->config = (new PdfConfiguration($this))->init();
|
$this->config = (new PdfConfiguration($this))->init();
|
||||||
|
|
||||||
$this->html_variables = $this->config->client ?
|
|
||||||
(new HtmlEngine($invitation))->generateLabelsAndValues() :
|
|
||||||
(new VendorHtmlEngine($invitation))->generateLabelsAndValues();
|
|
||||||
|
|
||||||
$this->designer = (new PdfDesigner($this))->build();
|
|
||||||
|
|
||||||
$this->document_type = $document_type;
|
$this->document_type = $document_type;
|
||||||
|
|
||||||
$this->options = $options;
|
$this->options = $options;
|
||||||
|
|
||||||
$this->builder = (new PdfBuilder($this))->build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,6 +114,27 @@ class PdfService
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize all the services to build the PDF
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function init(): self
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->html_variables = $this->config->client ?
|
||||||
|
(new HtmlEngine($this->invitation))->generateLabelsAndValues() :
|
||||||
|
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();
|
||||||
|
|
||||||
|
$this->designer = (new PdfDesigner($this))->build();
|
||||||
|
|
||||||
|
|
||||||
|
$this->builder = (new PdfBuilder($this))->build();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* resolvePdfEngine
|
* resolvePdfEngine
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user