mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 04:34:35 -04:00
Catch edge case where client tax data is not configured
This commit is contained in:
parent
0b55e49111
commit
57f6bce7d9
@ -145,11 +145,6 @@ class BaseRule implements RuleInterface
|
|||||||
|
|
||||||
$this->client = $invoice->client;
|
$this->client = $invoice->client;
|
||||||
|
|
||||||
if(!$this->client->tax_data){
|
|
||||||
$this->should_calc_tax = false;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->resolveRegions();
|
$this->resolveRegions();
|
||||||
|
|
||||||
if(!$this->isTaxableRegion())
|
if(!$this->isTaxableRegion())
|
||||||
@ -240,7 +235,7 @@ class BaseRule implements RuleInterface
|
|||||||
$this->client_region = $this->region_codes[$this->client->country->iso_3166_2];
|
$this->client_region = $this->region_codes[$this->client->country->iso_3166_2];
|
||||||
|
|
||||||
match($this->client_region){
|
match($this->client_region){
|
||||||
'US' => $this->client_subregion = strlen($this->invoice?->client?->tax_data?->geoState) > 1 ? $this->invoice->client->tax_data->geoState : $this->getUSState(),
|
'US' => $this->client_subregion = isset($this->invoice?->client?->tax_data?->geoState) ? $this->invoice->client->tax_data->geoState : $this->getUSState(),
|
||||||
'EU' => $this->client_subregion = $this->client->country->iso_3166_2,
|
'EU' => $this->client_subregion = $this->client->country->iso_3166_2,
|
||||||
'AU' => $this->client_subregion = 'AU',
|
'AU' => $this->client_subregion = 'AU',
|
||||||
default => $this->client_subregion = $this->client->country->iso_3166_2,
|
default => $this->client_subregion = $this->client->country->iso_3166_2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user