From bb159be38683139f4fd6650a66d286aa678e1bbb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 2 Jul 2024 18:36:53 +1000 Subject: [PATCH] Minor fixes for zug docs --- app/Services/EDocument/Imports/ZugferdEDocument.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/EDocument/Imports/ZugferdEDocument.php b/app/Services/EDocument/Imports/ZugferdEDocument.php index f8ec7a6f7dd9..2f2384998201 100644 --- a/app/Services/EDocument/Imports/ZugferdEDocument.php +++ b/app/Services/EDocument/Imports/ZugferdEDocument.php @@ -41,6 +41,7 @@ class ZugferdEDocument extends AbstractService { */ public function run(): Expense { + /** @var \App\Models\User $user */ $user = auth()->user(); $this->document = ZugferdDocumentReader::readAndGuessFromContent($this->tempdocument); $this->document->getDocumentInformation($documentno, $documenttypecode, $documentdate, $invoiceCurrency, $taxCurrency, $documentname, $documentlanguage, $effectiveSpecifiedPeriod); @@ -102,13 +103,13 @@ class ZugferdEDocument extends AbstractService { if ($taxid != null) { $vendor->vat_number = $taxid; } - $vendor->currency_id = Currency::whereCode($invoiceCurrency)->first()->id; + $vendor->currency_id = Currency::query()->where('code', $invoiceCurrency)->first()->id; $vendor->phone = $contact_phone; $vendor->address1 = $address_1; $vendor->address2 = $address_2; $vendor->city = $city; $vendor->postal_code = $postcode; - $vendor->country_id = Country::where('iso_3166_2', $country)->first()->id; + $vendor->country_id = Country::query()->where('iso_3166_2', $country)->first()->id; $vendor->save(); $expense->vendor_id = $vendor->id;