From 80e20c0f1eb895255a108652c21d70dcfdf19d03 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 8 May 2023 19:42:47 +1000 Subject: [PATCH] Fixes for client tax_data --- app/DataMapper/Tax/BaseRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DataMapper/Tax/BaseRule.php b/app/DataMapper/Tax/BaseRule.php index 714fd3c3c317..6f664dd8148f 100644 --- a/app/DataMapper/Tax/BaseRule.php +++ b/app/DataMapper/Tax/BaseRule.php @@ -160,7 +160,7 @@ class BaseRule implements RuleInterface return $this; //determine if we are taxing locally or if we are taxing globally - $tax_data = $this->invoice->client->tax_data ?? new Response([]); + $tax_data = is_object($this->invoice->client->tax_data) ? $this->invoice->client->tax_data : new Response([]); if(strlen($this->invoice->tax_data?->originDestination) == 0 && $this->client->company->tax_data->seller_subregion != $this->client_subregion) { $tax_data->originDestination = "D";