From 35d84496efda8a422bde96e46775312cca3d0ea5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 19 Apr 2023 11:11:04 +1000 Subject: [PATCH] Minor fixes for e invoices --- app/Jobs/Invoice/CreateXInvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/Invoice/CreateXInvoice.php b/app/Jobs/Invoice/CreateXInvoice.php index 45f8e6bd7b45..0b843825fead 100644 --- a/app/Jobs/Invoice/CreateXInvoice.php +++ b/app/Jobs/Invoice/CreateXInvoice.php @@ -159,7 +159,7 @@ class CreateXInvoice implements ShouldQueue $xrechnung->addDocumentTax($this->getTaxType("", $invoice), "VAT", $item["total"] / (explode("%", end($tax))[0] / 100), $item["total"], explode("%", end($tax))[0]); // TODO: Add correct tax type within getTaxType } - if (!empty($globaltax)){ + if (!empty($globaltax && isset($invoicing_data->getTotalTaxMap()[$globaltax]["name"]))){ $tax = explode(" ", $invoicing_data->getTotalTaxMap()[$globaltax]["name"]); $xrechnung->addDocumentTax($this->getTaxType("", $invoice), "VAT", $invoicing_data->getTotalTaxMap()[$globaltax]["total"] / (explode("%", end($tax))[0] / 100), $invoicing_data->getTotalTaxMap()[$globaltax]["total"], explode("%", end($tax))[0]); // TODO: Add correct tax type within getTaxType