arca-sdk 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs +54 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +53 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ Todos los cambios notables de este proyecto se documentan en este archivo.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.2.0] — 2026-03-18
|
|
8
|
+
|
|
9
|
+
### ✨ Developer Experience (DX) y Normativas 2025
|
|
10
|
+
|
|
11
|
+
- **VatCondition Enum**: Se introdujo el enumerador fuertemente tipado `VatCondition` para facilitar el envío del parámetro `<ar:CondicionIVAReceptorId>` (obligatorio para ciertas Facturas C según la RG 5616/2024 efectiva desde 2025). Ahora la interfaz `Buyer` acepta este enum en su propiedad `vatCondition`, previniendo errores por el uso de números mágicos (ej. `VatCondition.CONSUMIDOR_FINAL` en lugar de `5`).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## [1.1.2] — 2026-03-04
|
|
16
|
+
|
|
17
|
+
### 🐛 Fixes en Nodos para Facturas de Servicios (RG 5616)
|
|
18
|
+
|
|
19
|
+
- **Condición IVA Receptor Nativas**: Se solucionó un bug por el cual `<ar:CondicionIVAReceptorId>` no se renderizaba como nodo de primer nivel en `FECAEDetRequest`, requisito fundamental de la RG 5616 para Factura C de ciertos compradores. Ahora puede enviarse vía `buyer.vatCondition`.
|
|
20
|
+
- **Fechas de Servicio**: Se añadió inyección nativa de `<ar:FchServDesde>`, `<ar:FchServHasta>` y `<ar:FchVtoPago>` para cuando se facturan Conceptos `2` o `3` (Servicios o Productos + Servicios). Se puede especificar enviando el parámetro `serviceDates` en la Request.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
7
24
|
## [1.1.1] — 2026-03-03
|
|
8
25
|
|
|
9
26
|
### ✨ Soporte para Opcionales y Resolución General 5616
|
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
InvoiceType: () => InvoiceType,
|
|
39
39
|
PadronService: () => PadronService,
|
|
40
40
|
TaxIdType: () => TaxIdType,
|
|
41
|
+
VatCondition: () => VatCondition,
|
|
41
42
|
WsaaService: () => WsaaService,
|
|
42
43
|
WsfeService: () => WsfeService,
|
|
43
44
|
generateQRUrl: () => generateQRUrl
|
|
@@ -543,6 +544,21 @@ var TaxIdType = /* @__PURE__ */ ((TaxIdType2) => {
|
|
|
543
544
|
TaxIdType2[TaxIdType2["FINAL_CONSUMER"] = 99] = "FINAL_CONSUMER";
|
|
544
545
|
return TaxIdType2;
|
|
545
546
|
})(TaxIdType || {});
|
|
547
|
+
var VatCondition = /* @__PURE__ */ ((VatCondition2) => {
|
|
548
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO"] = 1] = "IVA_RESPONSABLE_INSCRIPTO";
|
|
549
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_NO_INSCRIPTO"] = 2] = "IVA_RESPONSABLE_NO_INSCRIPTO";
|
|
550
|
+
VatCondition2[VatCondition2["IVA_NO_RESPONSABLE"] = 3] = "IVA_NO_RESPONSABLE";
|
|
551
|
+
VatCondition2[VatCondition2["IVA_SUJETO_EXENTO"] = 4] = "IVA_SUJETO_EXENTO";
|
|
552
|
+
VatCondition2[VatCondition2["CONSUMIDOR_FINAL"] = 5] = "CONSUMIDOR_FINAL";
|
|
553
|
+
VatCondition2[VatCondition2["RESPONSABLE_MONOTRIBUTO"] = 6] = "RESPONSABLE_MONOTRIBUTO";
|
|
554
|
+
VatCondition2[VatCondition2["SUJETO_NO_CATEGORIZADO"] = 7] = "SUJETO_NO_CATEGORIZADO";
|
|
555
|
+
VatCondition2[VatCondition2["PROVEEDOR_DEL_EXTERIOR"] = 8] = "PROVEEDOR_DEL_EXTERIOR";
|
|
556
|
+
VatCondition2[VatCondition2["CLIENTE_DEL_EXTERIOR"] = 9] = "CLIENTE_DEL_EXTERIOR";
|
|
557
|
+
VatCondition2[VatCondition2["IVA_LIBERADO_LEY_19640"] = 10] = "IVA_LIBERADO_LEY_19640";
|
|
558
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION"] = 11] = "IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION";
|
|
559
|
+
VatCondition2[VatCondition2["MONOTRIBUTISTA_SOCIAL"] = 13] = "MONOTRIBUTISTA_SOCIAL";
|
|
560
|
+
return VatCondition2;
|
|
561
|
+
})(VatCondition || {});
|
|
546
562
|
|
|
547
563
|
// src/utils/calculations.ts
|
|
548
564
|
function calculateSubtotal(items, includesVAT = false) {
|
|
@@ -725,7 +741,8 @@ var WsfeService = class _WsfeService {
|
|
|
725
741
|
docType: 99 /* FINAL_CONSUMER */,
|
|
726
742
|
docNumber: "0"
|
|
727
743
|
},
|
|
728
|
-
optionals: params.optionals
|
|
744
|
+
optionals: params.optionals,
|
|
745
|
+
serviceDates: params.serviceDates
|
|
729
746
|
});
|
|
730
747
|
}
|
|
731
748
|
/**
|
|
@@ -743,7 +760,8 @@ var WsfeService = class _WsfeService {
|
|
|
743
760
|
docType: 99 /* FINAL_CONSUMER */,
|
|
744
761
|
docNumber: "0"
|
|
745
762
|
},
|
|
746
|
-
optionals: params.optionals
|
|
763
|
+
optionals: params.optionals,
|
|
764
|
+
serviceDates: params.serviceDates
|
|
747
765
|
});
|
|
748
766
|
return { ...cae, items: params.items };
|
|
749
767
|
}
|
|
@@ -988,7 +1006,8 @@ var WsfeService = class _WsfeService {
|
|
|
988
1006
|
date: params.date,
|
|
989
1007
|
vatData,
|
|
990
1008
|
includesVAT,
|
|
991
|
-
optionals: params.optionals
|
|
1009
|
+
optionals: params.optionals,
|
|
1010
|
+
serviceDates: params.serviceDates
|
|
992
1011
|
});
|
|
993
1012
|
}
|
|
994
1013
|
/**
|
|
@@ -1008,7 +1027,8 @@ var WsfeService = class _WsfeService {
|
|
|
1008
1027
|
},
|
|
1009
1028
|
items: params.items,
|
|
1010
1029
|
associatedInvoices: params.associatedInvoices,
|
|
1011
|
-
optionals: params.optionals
|
|
1030
|
+
optionals: params.optionals,
|
|
1031
|
+
serviceDates: params.serviceDates
|
|
1012
1032
|
});
|
|
1013
1033
|
}
|
|
1014
1034
|
/**
|
|
@@ -1055,6 +1075,7 @@ var WsfeService = class _WsfeService {
|
|
|
1055
1075
|
date: request.date || /* @__PURE__ */ new Date(),
|
|
1056
1076
|
buyer: request.buyer,
|
|
1057
1077
|
associatedInvoices: request.associatedInvoices,
|
|
1078
|
+
serviceDates: request.serviceDates,
|
|
1058
1079
|
net,
|
|
1059
1080
|
vat,
|
|
1060
1081
|
total,
|
|
@@ -1216,6 +1237,31 @@ var WsfeService = class _WsfeService {
|
|
|
1216
1237
|
});
|
|
1217
1238
|
asocXml += "\n </ar:CbtesAsoc>";
|
|
1218
1239
|
}
|
|
1240
|
+
let optXml = "";
|
|
1241
|
+
if (params.optionals && params.optionals.length > 0) {
|
|
1242
|
+
optXml = "<ar:Opcionales>";
|
|
1243
|
+
params.optionals.forEach((opt) => {
|
|
1244
|
+
optXml += `
|
|
1245
|
+
<ar:Opcional>
|
|
1246
|
+
<ar:Id>${opt.id}</ar:Id>
|
|
1247
|
+
<ar:Valor>${opt.value}</ar:Valor>
|
|
1248
|
+
</ar:Opcional>`;
|
|
1249
|
+
});
|
|
1250
|
+
optXml += "\n </ar:Opcionales>";
|
|
1251
|
+
}
|
|
1252
|
+
const condicionIVAReceptorXml = params.buyer?.vatCondition !== void 0 ? `
|
|
1253
|
+
<ar:CondicionIVAReceptorId>${params.buyer.vatCondition}</ar:CondicionIVAReceptorId>` : "";
|
|
1254
|
+
let fechasServicioXml = "";
|
|
1255
|
+
if (params.concept === 2 /* SERVICES */ || params.concept === 3 /* PRODUCTS_AND_SERVICES */) {
|
|
1256
|
+
const defaultDateStr = params.date.toISOString().split("T")[0].replace(/-/g, "");
|
|
1257
|
+
const startDateStr = params.serviceDates?.startDate ? params.serviceDates.startDate.toISOString().split("T")[0].replace(/-/g, "") : defaultDateStr;
|
|
1258
|
+
const endDateStr = params.serviceDates?.endDate ? params.serviceDates.endDate.toISOString().split("T")[0].replace(/-/g, "") : defaultDateStr;
|
|
1259
|
+
const dueDateStr = params.serviceDates?.dueDate ? params.serviceDates.dueDate.toISOString().split("T")[0].replace(/-/g, "") : defaultDateStr;
|
|
1260
|
+
fechasServicioXml = `
|
|
1261
|
+
<ar:FchServDesde>${startDateStr}</ar:FchServDesde>
|
|
1262
|
+
<ar:FchServHasta>${endDateStr}</ar:FchServHasta>
|
|
1263
|
+
<ar:FchVtoPago>${dueDateStr}</ar:FchVtoPago>`;
|
|
1264
|
+
}
|
|
1219
1265
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
1220
1266
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
|
|
1221
1267
|
xmlns:ar="http://ar.gov.afip.dif.FEV1/">
|
|
@@ -1237,7 +1283,7 @@ var WsfeService = class _WsfeService {
|
|
|
1237
1283
|
<ar:FECAEDetRequest>
|
|
1238
1284
|
<ar:Concepto>${params.concept}</ar:Concepto>
|
|
1239
1285
|
<ar:DocTipo>${params.buyer?.docType || 99}</ar:DocTipo>
|
|
1240
|
-
<ar:DocNro>${params.buyer?.docNumber || 0}</ar:DocNro
|
|
1286
|
+
<ar:DocNro>${params.buyer?.docNumber || 0}</ar:DocNro>${condicionIVAReceptorXml}
|
|
1241
1287
|
<ar:CbteDesde>${params.invoiceNumber}</ar:CbteDesde>
|
|
1242
1288
|
<ar:CbteHasta>${params.invoiceNumber}</ar:CbteHasta>
|
|
1243
1289
|
<ar:CbteFch>${dateStr}</ar:CbteFch>
|
|
@@ -1248,9 +1294,10 @@ var WsfeService = class _WsfeService {
|
|
|
1248
1294
|
<ar:ImpIVA>${params.vat.toFixed(2)}</ar:ImpIVA>
|
|
1249
1295
|
<ar:ImpTrib>0.00</ar:ImpTrib>
|
|
1250
1296
|
<ar:MonId>PES</ar:MonId>
|
|
1251
|
-
<ar:MonCotiz>1</ar:MonCotiz
|
|
1297
|
+
<ar:MonCotiz>1</ar:MonCotiz>${fechasServicioXml}
|
|
1252
1298
|
${asocXml}
|
|
1253
1299
|
${vatXml}
|
|
1300
|
+
${optXml}
|
|
1254
1301
|
</ar:FECAEDetRequest>
|
|
1255
1302
|
</ar:FeDetReq>
|
|
1256
1303
|
</ar:FeCAEReq>
|
|
@@ -1471,6 +1518,7 @@ var PadronService = class {
|
|
|
1471
1518
|
InvoiceType,
|
|
1472
1519
|
PadronService,
|
|
1473
1520
|
TaxIdType,
|
|
1521
|
+
VatCondition,
|
|
1474
1522
|
WsaaService,
|
|
1475
1523
|
WsfeService,
|
|
1476
1524
|
generateQRUrl
|