Skip to content
Merged
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/Objects/InvoiceObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class InvoiceObject extends FiscalDocumentDto
/** @var ?int */
public $codigoComprobante;
/** @var ?int */
public $codigoConcepto;
/** @var ?int */
public $codigoDocumento;
/** @var ?int */
public $numeroDocumento;
Expand All @@ -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 */
Expand Down
21 changes: 21 additions & 0 deletions src/Objects/Invoices/ConceptEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Copyright (C) 1997-2020 Reyesoft <info@reyesoft.com>.
*
* 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;
}
15 changes: 13 additions & 2 deletions src/WSFE/Wsfe.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -285,6 +295,7 @@ private function parseFacturaArray(): void
'ImpIVA' => $factura->importeIVA,
'MonId' => $factura->codigoMoneda,
'MonCotiz' => $factura->cotizacionMoneda,
'CondicionIVAReceptorId' => $factura->condicionIVAReceptorId,
],
],
];
Expand Down
Loading