mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 10:04:35 -04:00
Update tax rules for AT
This commit is contained in:
parent
445a36c4df
commit
da9d9ac395
44
app/DataMapper/Tax/AT/Rule.php
Normal file
44
app/DataMapper/Tax/AT/Rule.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Tax\AT;
|
||||||
|
|
||||||
|
use App\DataMapper\Tax\DE\Rule as DERule;
|
||||||
|
|
||||||
|
class Rule extends DERule
|
||||||
|
{
|
||||||
|
/** @var string $seller_region */
|
||||||
|
public string $seller_region = 'EU';
|
||||||
|
|
||||||
|
/** @var bool $consumer_tax_exempt */
|
||||||
|
public bool $consumer_tax_exempt = false;
|
||||||
|
|
||||||
|
/** @var bool $business_tax_exempt */
|
||||||
|
public bool $business_tax_exempt = false;
|
||||||
|
|
||||||
|
/** @var bool $eu_business_tax_exempt */
|
||||||
|
public bool $eu_business_tax_exempt = true;
|
||||||
|
|
||||||
|
/** @var bool $foreign_business_tax_exempt */
|
||||||
|
public bool $foreign_business_tax_exempt = false;
|
||||||
|
|
||||||
|
/** @var bool $foreign_consumer_tax_exempt */
|
||||||
|
public bool $foreign_consumer_tax_exempt = false;
|
||||||
|
|
||||||
|
/** @var float $tax_rate */
|
||||||
|
public float $tax_rate = 0;
|
||||||
|
|
||||||
|
/** @var float $reduced_tax_rate */
|
||||||
|
public float $reduced_tax_rate = 0;
|
||||||
|
|
||||||
|
public string $tax_name1 = 'USt';
|
||||||
|
|
||||||
|
}
|
@ -41,6 +41,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
/** @var float $reduced_tax_rate */
|
/** @var float $reduced_tax_rate */
|
||||||
public float $reduced_tax_rate = 0;
|
public float $reduced_tax_rate = 0;
|
||||||
|
|
||||||
|
public string $tax_name1 = 'MwSt.';
|
||||||
/**
|
/**
|
||||||
* Initializes the rules and builds any required data.
|
* Initializes the rules and builds any required data.
|
||||||
*
|
*
|
||||||
@ -90,7 +91,6 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
public function reverseTax($item): self
|
public function reverseTax($item): self
|
||||||
{
|
{
|
||||||
$this->tax_rate1 = 0;
|
$this->tax_rate1 = 0;
|
||||||
$this->tax_name1 = 'ermäßigte MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -103,8 +103,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
public function taxReduced($item): self
|
public function taxReduced($item): self
|
||||||
{
|
{
|
||||||
$this->tax_rate1 = $this->reduced_tax_rate;
|
$this->tax_rate1 = $this->reduced_tax_rate;
|
||||||
$this->tax_name1 = 'ermäßigte MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,8 +115,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
public function zeroRated($item): self
|
public function zeroRated($item): self
|
||||||
{
|
{
|
||||||
$this->tax_rate1 = 0;
|
$this->tax_rate1 = 0;
|
||||||
$this->tax_name1 = 'ermäßigte MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,8 +142,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->tax_rate1 = $this->tax_rate;
|
$this->tax_rate1 = $this->tax_rate;
|
||||||
$this->tax_name1 = 'MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +155,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->tax_rate1 = $this->tax_rate;
|
$this->tax_rate1 = $this->tax_rate;
|
||||||
$this->tax_name1 = 'MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +168,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->tax_rate1 = $this->tax_rate;
|
$this->tax_rate1 = $this->tax_rate;
|
||||||
$this->tax_name1 = 'MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,8 +181,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->tax_rate1 = $this->tax_rate;
|
$this->tax_rate1 = $this->tax_rate;
|
||||||
$this->tax_name1 = 'MwSt.';
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +221,8 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
$this->tax_rate = 0;
|
$this->tax_rate = 0;
|
||||||
$this->reduced_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");
|
nlog("euro zone and tax exempt");
|
||||||
$this->tax_rate = 0;
|
$this->tax_rate = 0;
|
||||||
@ -243,7 +238,7 @@ class Rule extends BaseRule implements RuleInterface
|
|||||||
{
|
{
|
||||||
$this->defaultForeign();
|
$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)
|
if(($this->client->company->tax_data->seller_subregion != $this->client_subregion) && $this->client->company->tax_data->regions->EU->has_sales_above_threshold)
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@ class InvoiceItemSum
|
|||||||
];
|
];
|
||||||
|
|
||||||
private array $tax_jurisdictions = [
|
private array $tax_jurisdictions = [
|
||||||
// 'AT', // Austria
|
'AT', // Austria
|
||||||
// 'BE', // Belgium
|
// 'BE', // Belgium
|
||||||
// 'BG', // Bulgaria
|
// 'BG', // Bulgaria
|
||||||
// 'CY', // Cyprus
|
// 'CY', // Cyprus
|
||||||
|
@ -447,6 +447,7 @@ class EuTaxTest extends TestCase
|
|||||||
'country_id' => 56,
|
'country_id' => 56,
|
||||||
'shipping_country_id' => 56,
|
'shipping_country_id' => 56,
|
||||||
'has_valid_vat_number' => false,
|
'has_valid_vat_number' => false,
|
||||||
|
'vat_number' => ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice = Invoice::factory()->create([
|
$invoice = Invoice::factory()->create([
|
||||||
@ -693,6 +694,7 @@ class EuTaxTest extends TestCase
|
|||||||
'country_id' => 56,
|
'country_id' => 56,
|
||||||
'shipping_country_id' => 56,
|
'shipping_country_id' => 56,
|
||||||
'has_valid_vat_number' => false,
|
'has_valid_vat_number' => false,
|
||||||
|
'vat_number' => ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice = Invoice::factory()->create([
|
$invoice = Invoice::factory()->create([
|
||||||
@ -750,6 +752,7 @@ class EuTaxTest extends TestCase
|
|||||||
'state' => 'CA',
|
'state' => 'CA',
|
||||||
'postal_code' => '90210',
|
'postal_code' => '90210',
|
||||||
'has_valid_vat_number' => false,
|
'has_valid_vat_number' => false,
|
||||||
|
'vat_number' => '',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice = Invoice::factory()->create([
|
$invoice = Invoice::factory()->create([
|
||||||
@ -805,6 +808,7 @@ class EuTaxTest extends TestCase
|
|||||||
'country_id' => 56,
|
'country_id' => 56,
|
||||||
'shipping_country_id' => 56,
|
'shipping_country_id' => 56,
|
||||||
'has_valid_vat_number' => false,
|
'has_valid_vat_number' => false,
|
||||||
|
'vat_number' => ''
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice = Invoice::factory()->create([
|
$invoice = Invoice::factory()->create([
|
||||||
@ -864,7 +868,7 @@ class EuTaxTest extends TestCase
|
|||||||
'user_id' => $this->user->id,
|
'user_id' => $this->user->id,
|
||||||
'status_id' => Invoice::STATUS_SENT,
|
'status_id' => Invoice::STATUS_SENT,
|
||||||
'tax_data' => new Response([
|
'tax_data' => new Response([
|
||||||
'geoState' => 'CA',
|
'geoState' => 'CA',
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user