From 9913d4c0b260d4d5a33ea92e7502181620ba1ffa Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 15 Oct 2023 17:15:38 +1100 Subject: [PATCH 1/2] Minor fixes for tax rules --- app/DataMapper/Tax/AU/Rule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DataMapper/Tax/AU/Rule.php b/app/DataMapper/Tax/AU/Rule.php index d6536e1a7177..c1d9e7ed218e 100644 --- a/app/DataMapper/Tax/AU/Rule.php +++ b/app/DataMapper/Tax/AU/Rule.php @@ -62,7 +62,7 @@ class Rule extends BaseRule implements RuleInterface public function taxByType($item): self { - if ($this->client->is_tax_exempt) { + if ($this->client->is_tax_exempt || !property_exists($item, 'tax_id')) { return $this->taxExempt($item); } From 14033459891de54ec545dee807495d3154944904 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 15 Oct 2023 17:16:27 +1100 Subject: [PATCH 2/2] Fixes for null or missing tax_id props --- app/DataMapper/Tax/BaseRule.php | 2 +- app/DataMapper/Tax/DE/Rule.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/DataMapper/Tax/BaseRule.php b/app/DataMapper/Tax/BaseRule.php index 36635429a6d7..ba8169734547 100644 --- a/app/DataMapper/Tax/BaseRule.php +++ b/app/DataMapper/Tax/BaseRule.php @@ -297,7 +297,7 @@ class BaseRule implements RuleInterface public function tax($item = null): self { - if ($this->client->is_tax_exempt) { + if ($this->client->is_tax_exempt || !property_exists($item, 'tax_id')) { return $this->taxExempt($item); diff --git a/app/DataMapper/Tax/DE/Rule.php b/app/DataMapper/Tax/DE/Rule.php index c82f701496f4..8214188c369f 100644 --- a/app/DataMapper/Tax/DE/Rule.php +++ b/app/DataMapper/Tax/DE/Rule.php @@ -63,7 +63,7 @@ class Rule extends BaseRule implements RuleInterface public function taxByType($item): self { - if ($this->client->is_tax_exempt) { + if ($this->client->is_tax_exempt || !property_exists($item, 'tax_id')) { return $this->taxExempt($item); }