1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00

Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop

This commit is contained in:
David Bomba 2023-06-03 09:06:19 +10:00
commit 944f72c521
6 changed files with 63 additions and 20 deletions

View File

@ -1 +1 @@
5.5.123
5.5.124

View 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';
}

View File

@ -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,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)
{

View File

@ -60,7 +60,7 @@ class InvoiceItemSum
];
private array $tax_jurisdictions = [
// 'AT', // Austria
'AT', // Austria
// 'BE', // Belgium
// 'BG', // Bulgaria
// 'CY', // Cyprus

View File

@ -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', ''),

View File

@ -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',
]),
]);