e-invoicing

This commit is contained in:
David Bomba 2023-04-28 17:15:19 +10:00
parent e2e9655e82
commit 3aaf09202a

View File

@ -154,9 +154,12 @@ class TemplateEmail extends Mailable
}
}
if ($this->invitation && $this->invitation->invoice && $this->invitation->invoice->client->getSetting('enable_e_invoice') && $this->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
$this->invitation->invoice->service()->getEInvoice($this->invitation->contact);
$disk = config('filesystems.default');
$this->attach(Storage::disk($disk)->path($this->invitation->invoice->client->xinvoice_filepath($this->invitation->invoice->invitations->first()) . $this->invitation->invoice->getFileName("xml")));
$xinvoice_filepath = $this->invitation->invoice->service()->getEInvoice($this->invitation->contact);
if(Storage::disk(config('filesystems.default'))->exists($xinvoice_filepath))
$this->attach(Storage::disk(config('filesystems.default'))->path($xinvoice_filepath), ['as' => $this->invitation->invoice->getFileName("xml"), 'mime' => null]);
}
return $this;