diff --git a/app/Services/EDocument/Standards/Verifactu.php b/app/Services/EDocument/Standards/Verifactu.php index dd466ab997..5e3a23b43d 100644 --- a/app/Services/EDocument/Standards/Verifactu.php +++ b/app/Services/EDocument/Standards/Verifactu.php @@ -41,7 +41,7 @@ class Verifactu { $client = new VerifactuClient(VerifactuClient::MODE_PROD); - $response =$client->sendRegistroAlta($this->getRegistroAlta()); + $response = $client->sendRegistroAlta($this->getRegistroAlta()); var_dump($response); @@ -56,12 +56,16 @@ class Verifactu $soapBody = new SoapBody(); $RegFactuSistemaFacturacion = new RegFactuSistemaFacturacion(); + + //The User or Corp that generated AND sends the invoice (ie Invoice Ninja!) $cabecera = new Cabecera(); $obligadoEmision = new ObligadoEmision(); $obligadoEmision->setNombreRazon($this->invoice->company->present()->name()); $obligadoEmision->setNIF($this->invoice->company->settings->vat_number); $cabecera->setObligadoEmision($obligadoEmision); $RegFactuSistemaFacturacion->setCabecera($cabecera); + + //The invoice itself $RegFactuSistemaFacturacion->setRegistroAlta($regAlta); $soapBody->setRegFactuSistemaFacturacion($RegFactuSistemaFacturacion); diff --git a/app/Services/EDocument/Standards/Verifactu/InvoiceninjaToVerifactuMapper.php b/app/Services/EDocument/Standards/Verifactu/InvoiceninjaToVerifactuMapper.php index 919eac0d4b..40e27f9a01 100644 --- a/app/Services/EDocument/Standards/Verifactu/InvoiceninjaToVerifactuMapper.php +++ b/app/Services/EDocument/Standards/Verifactu/InvoiceninjaToVerifactuMapper.php @@ -72,7 +72,7 @@ class InvoiceninjaToVerifactuMapper $registroAlta->setIDVersion('1.0'); // Set invoice ID (IDFactura) - $idFactura = new IDFactura(); // Issued Invoice ID + $idFactura = new IDFactura(); // Issued Invoice ID (Invoice) $idFactura->setIDEmisorFactura($invoice->company->settings->vat_number); // Invoice Issuer ID $idFactura->setNumSerieFactura($invoice->number); // Invoice Serial Number $idFactura->setFechaExpedicionFactura(\Carbon\Carbon::parse($invoice->date)->format('d-m-Y')); // Invoice Issue Date