diff --git a/app/DataMapper/Tax/BaseRule.php b/app/DataMapper/Tax/BaseRule.php index fc71eaa498ae..2b114e9990aa 100644 --- a/app/DataMapper/Tax/BaseRule.php +++ b/app/DataMapper/Tax/BaseRule.php @@ -148,8 +148,8 @@ class BaseRule implements RuleInterface { /* If the client Country is not in the region_codes, we force the company country onto the client? @TODO */ if(!array_key_exists($this->client->country->iso_3166_2, $this->region_codes)) { - $this->client->country_id = $this->invoice->company->settings->country_id; - $this->client->saveQuietly(); + // $this->client->country_id = $this->invoice->company->settings->country_id; + // $this->client->saveQuietly(); nlog('Automatic tax calculations not supported for this country - defaulting to company country'); diff --git a/app/Helpers/Invoice/InvoiceItemSum.php b/app/Helpers/Invoice/InvoiceItemSum.php index fd1cc9c390ff..5930f8856bbb 100644 --- a/app/Helpers/Invoice/InvoiceItemSum.php +++ b/app/Helpers/Invoice/InvoiceItemSum.php @@ -144,7 +144,10 @@ class InvoiceItemSum return $this; } - if (in_array($this->client->company->country()->iso_3166_2, $this->tax_jurisdictions)) { //only calculate for supported tax jurisdictions + if (in_array($this->client->company->country()->iso_3166_2, $this->tax_jurisdictions) && in_array($this->client->country->iso_3166_2, $this->tax_jurisdictions)) { //only calculate for supported tax jurisdictions + + nlog($this->client->country->iso_3166_2); + nlog($this->client->company->country()->iso_3166_2); $class = "App\DataMapper\Tax\\".$this->client->company->country()->iso_3166_2."\\Rule"; diff --git a/tests/Feature/Scheduler/SchedulerTest.php b/tests/Feature/Scheduler/SchedulerTest.php index 579186e7c597..c4f58e235ff5 100644 --- a/tests/Feature/Scheduler/SchedulerTest.php +++ b/tests/Feature/Scheduler/SchedulerTest.php @@ -100,7 +100,7 @@ class SchedulerTest extends TestCase 'clients' => [], 'report_keys' => [], 'client_id' => $this->client->hashed_id, - 'report_name' => 'product_sales_report', + 'report_name' => 'product_sales', ], ]; @@ -147,7 +147,7 @@ class SchedulerTest extends TestCase 'clients' => [$this->client->hashed_id], 'report_keys' => [], 'client_id' => null, - 'report_name' => 'product_sales_report', + 'report_name' => 'product_sales', ], ]; @@ -193,7 +193,7 @@ class SchedulerTest extends TestCase 'clients' => [], 'report_keys' => [], 'client_id' => null, - 'report_name' => 'product_sales_report', + 'report_name' => 'product_sales', ], ]; @@ -234,7 +234,7 @@ class SchedulerTest extends TestCase 'parameters' => [ 'date_range' => EmailStatement::LAST_MONTH, 'clients' => [], - 'report_name' => 'product_sales_report', + 'report_name' => 'product_sales', ], ];