Skip to content

Commit d9cd391

Browse files
committed
Ares: ADIS set vat_payer = null if does not exists
1 parent 618894a commit d9cd391

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

changelog.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ Přidal jsem ADIS, služba která ověří zda se jedná o plátce DPH, identifi
4242

4343
### Chování validace pomocí ADIS
4444

45-
| | ARES | ADIS (Data::$adis::$exists) | Data::$vat_payer | Data::$tin | Spolehlivý plátce DPH Data::$adis::$reliable |
46-
|----------------------|-----------|-----------------------------|------------------|------------|----------------------------------------------|
47-
| Plátce DPH | vrací DIČ | Existuje (true) | true | vyplněno | true/false |
48-
| Skupinové DPH | vrátí DIČ | Neexistuje (false) | true | null | null |
49-
| Identifikovaná osoba | vrátí DIČ | Existuje (true) | false | vyplněno | null |
50-
| neplátce | null | null | false | null | null |
45+
| | ARES | ADIS (Data::$adis::$exists) | Data::$vat_payer | Data::$tin | Spolehlivý plátce DPH Data::$adis::$reliable |
46+
|-------------------------------------|-----------|-----------------------------|------------------|------------|----------------------------------------------|
47+
| Plátce DPH | vrací DIČ | Existuje (true) | true | vyplněno | true/false |
48+
| Skupinové DPH / již není plátce DPH | vrátí DIČ | Neexistuje (false) | null * | null | null |
49+
| Identifikovaná osoba | vrátí DIČ | Existuje (true) | false | vyplněno | null |
50+
| neplátce | null | null | false | null | null |
51+
52+
> * Nelze určit, zda se jedná o Skupinové DPH nebo společnost již není plátce DPH
5153
5254
# v2.0.0
5355

src/Ares/Core/Data.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Data implements JsonSerializable, Stringable
4545
*/
4646
public ?string $tin;
4747

48-
public bool $vat_payer;
48+
public ?bool $vat_payer;
4949

5050
public ?string $zip;
5151

@@ -74,6 +74,7 @@ public function setAdis(Subject $adis): void
7474
$this->vat_payer = $adis->isVatPayer;
7575
$this->tin = $adis->tin;
7676
} else {
77+
$this->vat_payer = null;
7778
$this->tin = null;
7879
}
7980

tests/fixtures/ares/02445344.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"house_number": "682\/34a",
1313
"street": "K\u0159i\u017e\u00edkova",
1414
"tin": null,
15-
"vat_payer": true,
15+
"vat_payer": null,
1616
"zip": "18600",
1717
"country": "\u010cesk\u00e1 republika",
1818
"country_code": "CZ",

tests/fixtures/ares/49240901.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"house_number": "1716\/2b",
1313
"street": "Hv\u011bzdova",
1414
"tin": null,
15-
"vat_payer": true,
15+
"vat_payer": null,
1616
"zip": "14000",
1717
"country": "\u010cesk\u00e1 republika",
1818
"country_code": "CZ",

tests/src/E2E/Ares/CoreTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testGroupVAT(): void
6363
$in = '2319918';
6464
$data = (new Ares\AresFactory())->create()->loadBasic($in);
6565
Assert::null($data->tin);
66-
Assert::true($data->vat_payer);
66+
Assert::null($data->vat_payer);
6767
}
6868

6969

0 commit comments

Comments
 (0)