diff --git a/app/Services/EDocument/Standards/Verifactu/Models/Invoice.php b/app/Services/EDocument/Standards/Verifactu/Models/Invoice.php index 0a4ebfb415..d4167cd123 100644 --- a/app/Services/EDocument/Standards/Verifactu/Models/Invoice.php +++ b/app/Services/EDocument/Standards/Verifactu/Models/Invoice.php @@ -68,7 +68,7 @@ class Invoice extends BaseXmlModel public function getFechaExpedicionFactura(): string { - return $this->fechaExpedicionFactura ?? now()->format('Y-m-d'); + return $this->fechaExpedicionFactura ?? now()->format('d-m-Y'); } public function setFechaExpedicionFactura(string $fechaExpedicionFactura): self diff --git a/tests/Feature/EInvoice/Verifactu/Models/VerifactuInvoiceTest.php b/tests/Feature/EInvoice/Verifactu/Models/VerifactuInvoiceTest.php index ff424ca946..95794023d5 100644 --- a/tests/Feature/EInvoice/Verifactu/Models/VerifactuInvoiceTest.php +++ b/tests/Feature/EInvoice/Verifactu/Models/VerifactuInvoiceTest.php @@ -1270,6 +1270,11 @@ class VerifactuInvoiceTest extends TestCase $validateXmlMethod = $reflectionClass->getMethod('validateXml'); $validateXmlMethod->setAccessible(true); $validateXmlMethod->invoke(new Invoice(), $doc); + + $xslt = new XsltDocumentValidator($validXml); + $xslt->validate(); + + $this->assertCount(0, $xslt->getErrors()); } // public function testSignatureGeneration(): void