From ca57ffd8ef1877509510463b90ee50777d747c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 15 Aug 2023 14:33:37 +0300 Subject: [PATCH] Fixed missing tax on create or update document --- app/Jobs/Document/CreateDocumentItem.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Jobs/Document/CreateDocumentItem.php b/app/Jobs/Document/CreateDocumentItem.php index 3e81058af..82746bf4c 100644 --- a/app/Jobs/Document/CreateDocumentItem.php +++ b/app/Jobs/Document/CreateDocumentItem.php @@ -68,6 +68,12 @@ class CreateDocumentItem extends Job implements HasOwner, HasSource, ShouldCreat // New variables by tax type & tax sorting foreach ((array) $this->request['tax_ids'] as $tax_id) { $tax = Tax::find($tax_id); + + // If tax not found, skip + if (! $tax) { + continue; + } + ${$tax->type . 's'}[] = $tax; }