diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b0a8a4..f9ad8ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [2.0.11] - 2025-04-28 + ### Changed - Some enums removed. +### Added +- condicionIVAReceptorId and codigoConcepto on InvoiceObject. +- Support for multiple observations on Invoice result. + ## [2.0.10] - 2025-01-18 ### Added - Some enums changed based on AFIP/ARCA. diff --git a/src/Objects/InvoiceObject.php b/src/Objects/InvoiceObject.php index 279d2cb..7e9d33b 100644 --- a/src/Objects/InvoiceObject.php +++ b/src/Objects/InvoiceObject.php @@ -24,6 +24,8 @@ class InvoiceObject extends FiscalDocumentDto /** @var ?int */ public $codigoComprobante; /** @var ?int */ + public $codigoConcepto; + /** @var ?int */ public $codigoDocumento; /** @var ?int */ public $numeroDocumento; @@ -47,6 +49,8 @@ class InvoiceObject extends FiscalDocumentDto public $codigoMoneda = 'PES'; /** @var int */ public $cotizacionMoneda = 1; + /** @var ?int */ + public $condicionIVAReceptorId; /** @var string */ public $fechaServicioDesde; /** @var string */ diff --git a/src/Objects/Invoices/ConceptEnum.php b/src/Objects/Invoices/ConceptEnum.php new file mode 100644 index 0000000..ea60a38 --- /dev/null +++ b/src/Objects/Invoices/ConceptEnum.php @@ -0,0 +1,21 @@ +. + * + * This file is part of php-afip-ws. php-afip-ws can not be copied and/or + * distributed without the express permission of Reyesoft + */ + +declare(strict_types=1); + +namespace Multinexo\Objects\Invoices; + +/** + * https://www.arca.gob.ar/ws/documentacion/manuales/manual-desarrollador-ARCA-COMPG-v4-0.pdf. + */ +class ConceptEnum +{ + public const PRODUCTOS = 1; + public const SERVICIOS = 2; + public const PRODUCTOS_SERVICIOS = 3; +} diff --git a/src/WSFE/Wsfe.php b/src/WSFE/Wsfe.php index 983b508..5aab1c2 100644 --- a/src/WSFE/Wsfe.php +++ b/src/WSFE/Wsfe.php @@ -69,8 +69,18 @@ private function parseResult(stdClass $response): InvoiceResultObject $result->cae = $response->CAE; $result->cae_expiration_date = $response->CAEFchVto; - if (isset($response->Observaciones)) { - $result->observation = $response->Observaciones->Obs->Msg . ' (' . $response->Observaciones->Obs->Code . ')'; + + if (!empty($response->Observaciones->Obs)) { + $messages = is_array($response->Observaciones->Obs) + ? $response->Observaciones->Obs + : [$response->Observaciones->Obs]; + $result->observation = implode(PHP_EOL, + array_map( + function ($obs) { + return $obs->Msg . ' (' . $obs->Code . ').'; + }, + $messages + )); } return $result; @@ -285,6 +295,7 @@ private function parseFacturaArray(): void 'ImpIVA' => $factura->importeIVA, 'MonId' => $factura->codigoMoneda, 'MonCotiz' => $factura->cotizacionMoneda, + 'CondicionIVAReceptorId' => $factura->condicionIVAReceptorId, ], ], ];