mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop
This commit is contained in:
commit
944f72c521
@ -1 +1 @@
|
||||
5.5.123
|
||||
5.5.124
|
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 */
|
||||
public float $reduced_tax_rate = 0;
|
||||
|
||||
public string $tax_name1 = 'MwSt.';
|
||||
/**
|
||||
* Initializes the rules and builds any required data.
|
||||
*
|
||||
@ -90,7 +91,6 @@ class Rule extends BaseRule implements RuleInterface
|
||||
public function reverseTax($item): self
|
||||
{
|
||||
$this->tax_rate1 = 0;
|
||||
$this->tax_name1 = 'ermäßigte MwSt.';
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -103,7 +103,6 @@ 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,7 +115,6 @@ class Rule extends BaseRule implements RuleInterface
|
||||
public function zeroRated($item): self
|
||||
{
|
||||
$this->tax_rate1 = 0;
|
||||
$this->tax_name1 = 'ermäßigte MwSt.';
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -144,7 +142,6 @@ class Rule extends BaseRule implements RuleInterface
|
||||
{
|
||||
|
||||
$this->tax_rate1 = $this->tax_rate;
|
||||
$this->tax_name1 = 'MwSt.';
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -158,7 +155,6 @@ class Rule extends BaseRule implements RuleInterface
|
||||
{
|
||||
|
||||
$this->tax_rate1 = $this->tax_rate;
|
||||
$this->tax_name1 = 'MwSt.';
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -172,7 +168,6 @@ class Rule extends BaseRule implements RuleInterface
|
||||
{
|
||||
|
||||
$this->tax_rate1 = $this->tax_rate;
|
||||
$this->tax_name1 = 'MwSt.';
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -186,7 +181,6 @@ 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)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ class InvoiceItemSum
|
||||
];
|
||||
|
||||
private array $tax_jurisdictions = [
|
||||
// 'AT', // Austria
|
||||
'AT', // Austria
|
||||
// 'BE', // Belgium
|
||||
// 'BG', // Bulgaria
|
||||
// 'CY', // Cyprus
|
||||
|
@ -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', ''),
|
||||
|
@ -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',
|
||||
]),
|
||||
]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user