Skip to content

Commit a1e9c12

Browse files
authored
fix/observations msg (#53)
1 parent 372faec commit a1e9c12

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [2.0.11] - 2025-04-28
10+
811
### Changed
912
- Some enums removed.
1013

14+
### Added
15+
- condicionIVAReceptorId and codigoConcepto on InvoiceObject.
16+
- Support for multiple observations on Invoice result.
17+
1118
## [2.0.10] - 2025-01-18
1219
### Added
1320
- Some enums changed based on AFIP/ARCA.

src/Objects/InvoiceObject.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class InvoiceObject extends FiscalDocumentDto
2424
/** @var ?int */
2525
public $codigoComprobante;
2626
/** @var ?int */
27+
public $codigoConcepto;
28+
/** @var ?int */
2729
public $codigoDocumento;
2830
/** @var ?int */
2931
public $numeroDocumento;
@@ -47,6 +49,8 @@ class InvoiceObject extends FiscalDocumentDto
4749
public $codigoMoneda = 'PES';
4850
/** @var int */
4951
public $cotizacionMoneda = 1;
52+
/** @var ?int */
53+
public $condicionIVAReceptorId;
5054
/** @var string */
5155
public $fechaServicioDesde;
5256
/** @var string */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright (C) 1997-2020 Reyesoft <[email protected]>.
4+
*
5+
* This file is part of php-afip-ws. php-afip-ws can not be copied and/or
6+
* distributed without the express permission of Reyesoft
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace Multinexo\Objects\Invoices;
12+
13+
/**
14+
* https://www.arca.gob.ar/ws/documentacion/manuales/manual-desarrollador-ARCA-COMPG-v4-0.pdf.
15+
*/
16+
class ConceptEnum
17+
{
18+
public const PRODUCTOS = 1;
19+
public const SERVICIOS = 2;
20+
public const PRODUCTOS_SERVICIOS = 3;
21+
}

src/WSFE/Wsfe.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,18 @@ private function parseResult(stdClass $response): InvoiceResultObject
6969

7070
$result->cae = $response->CAE;
7171
$result->cae_expiration_date = $response->CAEFchVto;
72-
if (isset($response->Observaciones)) {
73-
$result->observation = $response->Observaciones->Obs->Msg . ' (' . $response->Observaciones->Obs->Code . ')';
72+
73+
if (!empty($response->Observaciones->Obs)) {
74+
$messages = is_array($response->Observaciones->Obs)
75+
? $response->Observaciones->Obs
76+
: [$response->Observaciones->Obs];
77+
$result->observation = implode(PHP_EOL,
78+
array_map(
79+
function ($obs) {
80+
return $obs->Msg . ' (' . $obs->Code . ').';
81+
},
82+
$messages
83+
));
7484
}
7585

7686
return $result;
@@ -285,6 +295,7 @@ private function parseFacturaArray(): void
285295
'ImpIVA' => $factura->importeIVA,
286296
'MonId' => $factura->codigoMoneda,
287297
'MonCotiz' => $factura->cotizacionMoneda,
298+
'CondicionIVAReceptorId' => $factura->condicionIVAReceptorId,
288299
],
289300
],
290301
];

0 commit comments

Comments
 (0)