diff --git a/VERSION.txt b/VERSION.txt index c5f585ebed..0557f0a2aa 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.123 \ No newline at end of file +5.5.124 \ No newline at end of file diff --git a/app/DataMapper/Tax/AT/Rule.php b/app/DataMapper/Tax/AT/Rule.php new file mode 100644 index 0000000000..1c554b99a4 --- /dev/null +++ b/app/DataMapper/Tax/AT/Rule.php @@ -0,0 +1,44 @@ +tax_rate1 = 0; - $this->tax_name1 = 'ermäßigte MwSt.'; return $this; } @@ -103,8 +103,7 @@ class Rule extends BaseRule implements RuleInterface public function taxReduced($item): self { $this->tax_rate1 = $this->reduced_tax_rate; - $this->tax_name1 = 'ermäßigte MwSt.'; - + return $this; } @@ -116,8 +115,7 @@ class Rule extends BaseRule implements RuleInterface public function zeroRated($item): self { $this->tax_rate1 = 0; - $this->tax_name1 = 'ermäßigte MwSt.'; - + return $this; } @@ -144,8 +142,7 @@ class Rule extends BaseRule implements RuleInterface { $this->tax_rate1 = $this->tax_rate; - $this->tax_name1 = 'MwSt.'; - + return $this; } @@ -158,8 +155,7 @@ class Rule extends BaseRule implements RuleInterface { $this->tax_rate1 = $this->tax_rate; - $this->tax_name1 = 'MwSt.'; - + return $this; } @@ -172,8 +168,7 @@ class Rule extends BaseRule implements RuleInterface { $this->tax_rate1 = $this->tax_rate; - $this->tax_name1 = 'MwSt.'; - + return $this; } @@ -186,8 +181,7 @@ class Rule extends BaseRule implements RuleInterface { $this->tax_rate1 = $this->tax_rate; - $this->tax_name1 = 'MwSt.'; - + return $this; } @@ -227,7 +221,8 @@ class Rule extends BaseRule implements RuleInterface $this->tax_rate = 0; $this->reduced_tax_rate = 0; } - elseif($this->client_subregion != $this->client->company->tax_data->seller_subregion && in_array($this->client_subregion, $this->eu_country_codes) && $this->client->has_valid_vat_number && $this->eu_business_tax_exempt) + elseif($this->client_subregion != $this->client->company->tax_data->seller_subregion && in_array($this->client_subregion, $this->eu_country_codes) && $this->client->vat_number && $this->eu_business_tax_exempt) + // elseif($this->client_subregion != $this->client->company->tax_data->seller_subregion && in_array($this->client_subregion, $this->eu_country_codes) && $this->client->has_valid_vat_number && $this->eu_business_tax_exempt) { nlog("euro zone and tax exempt"); $this->tax_rate = 0; @@ -243,7 +238,7 @@ class Rule extends BaseRule implements RuleInterface { $this->defaultForeign(); } - elseif(in_array($this->client_subregion, $this->eu_country_codes) && !$this->client->has_valid_vat_number) //eu country / no valid vat + elseif(in_array($this->client_subregion, $this->eu_country_codes) && !$this->client->vat_number) //eu country / no valid vat { if(($this->client->company->tax_data->seller_subregion != $this->client_subregion) && $this->client->company->tax_data->regions->EU->has_sales_above_threshold) { diff --git a/app/Helpers/Invoice/InvoiceItemSum.php b/app/Helpers/Invoice/InvoiceItemSum.php index afb14ef5df..13e8636dbc 100644 --- a/app/Helpers/Invoice/InvoiceItemSum.php +++ b/app/Helpers/Invoice/InvoiceItemSum.php @@ -60,7 +60,7 @@ class InvoiceItemSum ]; private array $tax_jurisdictions = [ - // 'AT', // Austria + 'AT', // Austria // 'BE', // Belgium // 'BG', // Bulgaria // 'CY', // Cyprus diff --git a/config/ninja.php b/config/ninja.php index ee4559d30c..4d86a860d8 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.123', - 'app_tag' => '5.5.123', + 'app_version' => '5.5.124', + 'app_tag' => '5.5.124', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/tests/Unit/Tax/EuTaxTest.php b/tests/Unit/Tax/EuTaxTest.php index b497ddee4d..309d4a0293 100644 --- a/tests/Unit/Tax/EuTaxTest.php +++ b/tests/Unit/Tax/EuTaxTest.php @@ -447,6 +447,7 @@ class EuTaxTest extends TestCase 'country_id' => 56, 'shipping_country_id' => 56, 'has_valid_vat_number' => false, + 'vat_number' => '' ]); $invoice = Invoice::factory()->create([ @@ -693,6 +694,7 @@ class EuTaxTest extends TestCase 'country_id' => 56, 'shipping_country_id' => 56, 'has_valid_vat_number' => false, + 'vat_number' => '' ]); $invoice = Invoice::factory()->create([ @@ -750,6 +752,7 @@ class EuTaxTest extends TestCase 'state' => 'CA', 'postal_code' => '90210', 'has_valid_vat_number' => false, + 'vat_number' => '', ]); $invoice = Invoice::factory()->create([ @@ -805,6 +808,7 @@ class EuTaxTest extends TestCase 'country_id' => 56, 'shipping_country_id' => 56, 'has_valid_vat_number' => false, + 'vat_number' => '' ]); $invoice = Invoice::factory()->create([ @@ -864,7 +868,7 @@ class EuTaxTest extends TestCase 'user_id' => $this->user->id, 'status_id' => Invoice::STATUS_SENT, 'tax_data' => new Response([ - 'geoState' => 'CA', + 'geoState' => 'CA', ]), ]);