diff --git a/composer.json b/composer.json
index b09c63a9c6..d85705591a 100644
--- a/composer.json
+++ b/composer.json
@@ -90,7 +90,7 @@
"shopify/shopify-api": "^4.3",
"socialiteproviders/apple": "dev-master",
"socialiteproviders/microsoft": "^4.1",
- "spatie/laravel-data": "^3.5",
+ "spatie/laravel-data": "^4",
"sprain/swiss-qr-bill": "^4.3",
"square/square": "30.0.0.*",
"stripe/stripe-php": "^12",
diff --git a/composer.lock b/composer.lock
index 933468e458..5a952491e0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1356155e46e797b140685c105df97b8e",
+ "content-hash": "fa16490174cf1031f3b7de1dba43be9f",
"packages": [
{
"name": "adrienrn/php-mimetyper",
@@ -5034,18 +5034,18 @@
"source": {
"type": "git",
"url": "https://github.com/invoiceninja/einvoice.git",
- "reference": "39aec367c528ba66d923dc1d9e5c96f673bb46c7"
+ "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/39aec367c528ba66d923dc1d9e5c96f673bb46c7",
- "reference": "39aec367c528ba66d923dc1d9e5c96f673bb46c7",
+ "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5",
+ "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5",
"shasum": ""
},
"require": {
"illuminate/collections": "^10.48",
"sabre/xml": "^4.0",
- "spatie/laravel-data": "^3.6"
+ "spatie/laravel-data": "^4"
},
"require-dev": {
"nesbot/carbon": "^2",
@@ -5075,7 +5075,7 @@
"source": "https://github.com/invoiceninja/einvoice/tree/main",
"issues": "https://github.com/invoiceninja/einvoice/issues"
},
- "time": "2024-05-20T11:42:32+00:00"
+ "time": "2024-05-21T10:01:09+00:00"
},
{
"name": "invoiceninja/inspector",
@@ -11926,20 +11926,20 @@
},
{
"name": "spatie/laravel-data",
- "version": "3.12.0",
+ "version": "4.6.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-data.git",
- "reference": "d44e04839407bc32b029be59ba80090a5f720e91"
+ "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/laravel-data/zipball/d44e04839407bc32b029be59ba80090a5f720e91",
- "reference": "d44e04839407bc32b029be59ba80090a5f720e91",
+ "url": "https://api.github.com/repos/spatie/laravel-data/zipball/ee513f693f8ab8f915dc26cae079d7b2e5999a65",
+ "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65",
"shasum": ""
},
"require": {
- "illuminate/contracts": "^9.30|^10.0|^11.0",
+ "illuminate/contracts": "^10.0|^11.0",
"php": "^8.1",
"phpdocumentor/type-resolver": "^1.5",
"spatie/laravel-package-tools": "^1.9.0",
@@ -11948,21 +11948,21 @@
"require-dev": {
"fakerphp/faker": "^1.14",
"friendsofphp/php-cs-fixer": "^3.0",
- "inertiajs/inertia-laravel": "^0.6.3",
+ "inertiajs/inertia-laravel": "dev-master#4508fd1",
+ "livewire/livewire": "^3.0",
"mockery/mockery": "^1.6",
"nesbot/carbon": "^2.63",
- "nette/php-generator": "^3.5",
"nunomaduro/larastan": "^2.0",
- "orchestra/testbench": "^7.6|^8.0",
- "pestphp/pest": "^1.22",
- "pestphp/pest-plugin-laravel": "^1.3",
+ "orchestra/testbench": "^8.0|^9.0",
+ "pestphp/pest": "^2.31",
+ "pestphp/pest-plugin-laravel": "^2.0",
+ "pestphp/pest-plugin-livewire": "^2.1",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.1",
- "phpunit/phpunit": "^9.3",
+ "phpunit/phpunit": "^10.0",
"spatie/invade": "^1.0",
- "spatie/laravel-typescript-transformer": "^2.1.6",
- "spatie/pest-plugin-snapshots": "^1.1",
- "spatie/phpunit-snapshot-assertions": "^4.2",
+ "spatie/laravel-typescript-transformer": "^2.3",
+ "spatie/pest-plugin-snapshots": "^2.1",
"spatie/test-time": "^1.2"
},
"type": "library",
@@ -11975,8 +11975,7 @@
},
"autoload": {
"psr-4": {
- "Spatie\\LaravelData\\": "src",
- "Spatie\\LaravelData\\Database\\Factories\\": "database/factories"
+ "Spatie\\LaravelData\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -11999,7 +11998,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-data/issues",
- "source": "https://github.com/spatie/laravel-data/tree/3.12.0"
+ "source": "https://github.com/spatie/laravel-data/tree/4.6.0"
},
"funding": [
{
@@ -12007,7 +12006,7 @@
"type": "github"
}
],
- "time": "2024-04-24T09:27:45+00:00"
+ "time": "2024-05-03T15:01:04+00:00"
},
{
"name": "spatie/laravel-package-tools",
diff --git a/tests/Integration/Einvoice/FACT1Test.php b/tests/Integration/Einvoice/FACT1Test.php
index c33b9b7300..185b6450d2 100644
--- a/tests/Integration/Einvoice/FACT1Test.php
+++ b/tests/Integration/Einvoice/FACT1Test.php
@@ -50,7 +50,6 @@ class FACT1Test extends TestCase
$this->assertIsArray($rules);
-
$validation_array = Invoice::validate($array);
$this->assertIsArray($validation_array);
diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php
index 1ce319e096..09cbce53bf 100644
--- a/tests/Integration/Einvoice/FatturaPATest.php
+++ b/tests/Integration/Einvoice/FatturaPATest.php
@@ -320,6 +320,7 @@ class FatturaPATest extends TestCase
{
$files = [
+ 'tests/Integration/Einvoice/samples/fatturapa0.xml',
'tests/Integration/Einvoice/samples/fatturapa1.xml',
'tests/Integration/Einvoice/samples/fatturapa2.xml',
'tests/Integration/Einvoice/samples/fatturapa3.xml',
@@ -337,15 +338,20 @@ class FatturaPATest extends TestCase
$json = json_encode($xml);
$payload = json_decode($json, true);
+ nlog($payload);
+
$validation_array = false;
try {
+ nlog($f);
+
$rules = FatturaElettronica::getValidationRules($this->payload);
- nlog($rules);
+ // nlog($rules);
$this->assertIsArray($rules);
$payload = FatturaElettronica::from($payload)->toArray();
- // nlog($payload);
+ nlog($payload);
+
$this->assertIsArray($payload);
$validation_array = FatturaElettronica::validate($payload);
diff --git a/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml b/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml
index 1f34e62e30..23c84468d7 100644
--- a/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml
+++ b/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml
@@ -77,7 +77,7 @@
S // this is a speciffic identifier for the VAT type
19
-
+
VAT
@@ -92,21 +92,20 @@
1
- 1 // unitcode is a speciffic
- identifier for the type of product
- 335.00
- -
+ 1 // unitcode is a speciffic identifier for the type of product
+ 335.00
+
-
Some Description
Some product
- S // this is a speciffic identifier for the VAT type
- 19
-
+ S // this is a speciffic identifier for the VAT type
+ 19
+
VAT
-
+
335
diff --git a/tests/Integration/Einvoice/samples/fatturapa0.xml b/tests/Integration/Einvoice/samples/fatturapa0.xml
new file mode 100644
index 0000000000..23026d1661
--- /dev/null
+++ b/tests/Integration/Einvoice/samples/fatturapa0.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+ IT
+ 01234567890
+
+ 00001
+ FPR12
+ ABC1234
+
+
+
+
+
+ IT
+ 01234567890
+
+
+ SOCIETA' ALPHA SRL
+
+ RF01
+
+
+ VIALE ROMA 543
+ 07100
+ SASSARI
+ SS
+ IT
+
+
+
+
+ 09876543210
+
+ BETA GAMMA
+
+
+
+ VIA TORINO 38-B
+ 00145
+ ROMA
+ RM
+ IT
+
+
+
+
+
+
+ TD01
+ EUR
+ 2014-12-18
+ 123
+ LA FATTURA FA RIFERIMENTO AD UNA OPERAZIONE AAAA BBBBBBBBBBBBBBBBBB CCC
+ DDDDDDDDDDDDDDD E FFFFFFFFFFFFFFFFFFFF GGGGGGGGGG HHHHHHH II LLLLLLLLLLLLLLLLL
+ MMM NNNNN OO PPPPPPPPPPP QQQQ RRRR SSSSSSSSSSSSSS
+ SEGUE DESCRIZIONE CAUSALE NEL CASO IN CUI NON SIANO STATI SUFFICIENTI 200
+ CARATTERI AAAAAAAAAAA BBBBBBBBBBBBBBBBB
+
+
+ 1
+ 66685
+ 1
+
+
+
+
+ IT
+ 24681012141
+
+
+ Trasporto spa
+
+
+ 2012-10-22T16:46:12.000+02:00
+
+
+
+
+ 1
+ LA DESCRIZIONE DELLA FORNITURA PUO' SUPERARE I CENTO CARATTERI CHE
+ RAPPRESENTAVANO IL PRECEDENTE LIMITE DIMENSIONALE. TALE LIMITE NELLA NUOVA
+ VERSIONE E' STATO PORTATO A MILLE CARATTERI
+ 5.00
+ 1.00
+ 5.00
+ 22.00
+
+
+ 2
+ FORNITURE VARIE PER UFFICIO
+ 10.00
+ 2.00
+ 20.00
+ 22.00
+
+
+ 22.00
+ 27.00
+ 5.95
+ I
+
+
+ 22.00
+ 27.00
+ 5.95
+ I
+
+
+
+ TP01
+
+ MP01
+ 2015-01-30
+ 32.95
+
+
+
+
+
+
+ TD01
+ EUR
+ 2014-12-20
+ 456
+ LA FATTURA FA RIFERIMENTO AD UNA OPERAZIONE AAAA BBBBBBBBBBBBBBBBBB CCC
+ DDDDDDDDDDDDDDD E FFFFFFFFFFFFFFFFFFFF GGGGGGGGGG HHHHHHH II LLLLLLLLLLLLLLLLL
+ MMM NNNNN OO PPPPPPPPPPP QQQQ RRRR SSSSSSSSSSSSSS
+ SEGUE DESCRIZIONE CAUSALE NEL CASO IN CUI NON SIANO STATI SUFFICIENTI 200
+ CARATTERI AAAAAAAAAAA BBBBBBBBBBBBBBBBB
+
+
+ 1
+ 66685
+ 1
+
+
+
+
+ 1
+ PRESTAZIONE DEL SEGUENTE SERVIZIO PROFESSIONALE: LA DESCRIZIONE DELLA
+ PRESTAZIONE PUO' SUPERARE I CENTO CARATTERI CHE RAPPRESENTAVANO IL PRECEDENTE
+ LIMITE DIMENSIONALE. TALE LIMITE NELLA NUOVA VERSIONE E' STATO PORTATO A MILLE
+ CARATTERI
+ 2000.00
+ 2000.00
+ 22.00
+
+
+ 22.00
+ 2000.00
+ 440.00
+ I
+
+
+
+ TP01
+
+ MP19
+ 2015-01-28
+ 2440.00
+
+
+
+
\ No newline at end of file