Fixes for tests

This commit is contained in:
David Bomba 2024-06-18 11:59:05 +10:00
parent 99bf34b20f
commit cb0385dd39

View File

@ -114,11 +114,12 @@ class CreateRawPdf
} catch (\Exception) { } catch (\Exception) {
throw new FilePermissionsFailure('Unable to generate the raw PDF'); throw new FilePermissionsFailure('Unable to generate the raw PDF');
} }
if ($this->entity_string == "invoice" && $this->entity->client->getSetting("merge_e_invoice_to_pdf")) { if ($this->entity_string == "invoice" && $this->entity->client->getSetting("merge_e_invoice_to_pdf")) {
$pdf = (new MergeEDocument($this->entity, $pdf))->handle(); $pdf = (new MergeEDocument($this->entity, $pdf))->handle();
} }
$merge_docs = $this->entity->client ? $this->entity->client->getSetting('embed_documents') : $this->company->getSetting('embed_documents'); $merge_docs = isset($this->entity->client) ? $this->entity->client->getSetting('embed_documents') : $this->company->getSetting('embed_documents');
if($merge_docs && ($this->entity->documents()->where('is_public', true)->count() > 0 || $this->company->documents()->where('is_public', true)->count() > 0)) { if($merge_docs && ($this->entity->documents()->where('is_public', true)->count() > 0 || $this->company->documents()->where('is_public', true)->count() > 0)) {
$pdf = $this->entity->documentMerge($pdf); $pdf = $this->entity->documentMerge($pdf);